Commit 00243155 by Arnaud Charlet Committed by Pierre-Marie de Rodat

[Ada] Disable calls to Abort defer/undefer when ZCX_By_Default

2019-07-09  Arnaud Charlet  <charlet@adacore.com>

gcc/ada/

	* libgnat/s-memory.adb: Disable calls to Abort defer/undefer
	when ZCX_By_Default.

From-SVN: r273284
parent c7854dbd
2019-07-09 Arnaud Charlet <charlet@adacore.com>
* libgnat/s-memory.adb: Disable calls to Abort defer/undefer
when ZCX_By_Default.
2019-07-09 Javier Miranda <miranda@adacore.com>
* sem_ch13.adb (Rep_Item_Too_Early): Representation clauses are
......
......@@ -33,13 +33,10 @@
-- This implementation assumes that the underlying malloc/free/realloc
-- implementation is thread safe, and thus, no additional lock is required.
-- Note that we still need to defer abort because on most systems, an
-- asynchronous signal (as used for implementing asynchronous abort of
-- task) cannot safely be handled while malloc is executing.
-- If you are not using Ada constructs containing the "abort" keyword, then
-- you can remove the calls to Abort_Defer.all and Abort_Undefer.all from
-- this unit.
-- Note that when using sjlj exception handling, we still need to defer abort
-- because an asynchronous signal (as used for implementing asynchronous abort
-- of task on sjlj runtimes) cannot safely be handled while malloc is
-- executing.
pragma Compiler_Unit_Warning;
......@@ -80,7 +77,7 @@ package body System.Memory is
raise Storage_Error with "object too large";
end if;
if Parameters.No_Abort then
if ZCX_By_Default or else Parameters.No_Abort then
Result := c_malloc (System.CRTL.size_t (Size));
else
Abort_Defer.all;
......@@ -121,7 +118,7 @@ package body System.Memory is
procedure Free (Ptr : System.Address) is
begin
if Parameters.No_Abort then
if ZCX_By_Default or else Parameters.No_Abort then
c_free (Ptr);
else
Abort_Defer.all;
......@@ -145,7 +142,7 @@ package body System.Memory is
raise Storage_Error with "object too large";
end if;
if Parameters.No_Abort then
if ZCX_By_Default or else Parameters.No_Abort then
Result := c_realloc (Ptr, System.CRTL.size_t (Size));
else
Abort_Defer.all;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment