diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-10-05 14:21:21 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-10-05 14:21:21 +0000 |
commit | 21a554371e58786b978a35f09ce5c7b077fc1272 (patch) | |
tree | e30a3273ca8c8b3dbeac16e03a5145a5ef49fc86 /gcc/ada/s-spsufi.adb | |
parent | fd3f62d020503d19338f71de07dcb2faa224046f (diff) | |
download | gcc-21a554371e58786b978a35f09ce5c7b077fc1272.tar.gz |
2012-10-05 Yannick Moy <moy@adacore.com>
* switch-c.adb, checks.adb, checks.ads, sem_prag.adb, exp_ch4.adb,
osint.adb: Minor correction of typos, and special case for Alfa mode.
2012-10-05 Hristian Kirtchev <kirtchev@adacore.com>
* s-spsufi.adb: Add with clause for Ada.Unchecked_Deallocation.
Add with and use clauses for System.Finalization_Masters.
(Finalize_And_Deallocate): Add an instance of
Ada.Unchecked_Deallocation. Merge the code from the now obsolete
Finalize_Subpool into this routine.
* s-spsufi.ads: Add pragma Preelaborate.
* s-stposu.adb: Remove with clause for
Ada.Unchecked_Deallocation; Add with and use clauses for
System.Storage_Pools.Subpools.Finalization; (Finalize_Pool):
Update the comment on all actions takes with respect to a subpool
finalization. Finalize and deallocate each individual subpool.
(Finalize_Subpool): Removed.
(Free): Removed;
(Detach): Move from package body to spec.
* s-stposu.ads (Detach): Move from package body to spec.
(Finalize_Subpool): Removed.
2012-10-05 Arnaud Charlet <charlet@adacore.com>
* s-tassta.adb: Update comments.
(Vulnerable_Complete_Master): If Free_On_Termination is set, do
nothing, and let the task free itself if not already done.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@192124 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/s-spsufi.adb')
-rw-r--r-- | gcc/ada/s-spsufi.adb | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/gcc/ada/s-spsufi.adb b/gcc/ada/s-spsufi.adb index 86b18aad7df..9ed8e3ee5ec 100644 --- a/gcc/ada/s-spsufi.adb +++ b/gcc/ada/s-spsufi.adb @@ -7,7 +7,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2011, Free Software Foundation, Inc. -- +-- Copyright (C) 2011-2012, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -30,6 +30,9 @@ -- -- ------------------------------------------------------------------------------ +with Ada.Unchecked_Deallocation; +with System.Finalization_Masters; use System.Finalization_Masters; + package body System.Storage_Pools.Subpools.Finalization is ----------------------------- @@ -37,6 +40,8 @@ package body System.Storage_Pools.Subpools.Finalization is ----------------------------- procedure Finalize_And_Deallocate (Subpool : in out Subpool_Handle) is + procedure Free is new Ada.Unchecked_Deallocation (SP_Node, SP_Node_Ptr); + begin -- Do nothing if the subpool was never created or never used. The latter -- case may arise with an array of subpool implementations. @@ -48,9 +53,18 @@ package body System.Storage_Pools.Subpools.Finalization is return; end if; - -- Clean up all controlled objects allocated through the subpool + -- Clean up all controlled objects chained on the subpool's master + + Finalize (Subpool.Master); + + -- Remove the subpool from its owner's list of subpools + + Detach (Subpool.Node); + + -- Destroy the associated doubly linked list node which was created in + -- Set_Pool_Of_Subpools. - Finalize_Subpool (Subpool); + Free (Subpool.Node); -- Dispatch to the user-defined implementation of Deallocate_Subpool |