+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
-- 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;
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;
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;
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;