Deallocate (Pool, N_Addr, N_Size, Alignment);
end Deallocate_Any_Controlled;
+ ------------------------------
+ -- Default_Subpool_For_Pool --
+ ------------------------------
+
+ function Default_Subpool_For_Pool
+ (Pool : Root_Storage_Pool_With_Subpools) return not null Subpool_Handle
+ is
+ begin
+ raise Program_Error;
+
+ return Pool.Subpools.Subpool;
+ end Default_Subpool_For_Pool;
+
------------
-- Detach --
------------
---------------------
function Pool_Of_Subpool (Subpool : not null Subpool_Handle)
- return access Root_Storage_Pool_With_Subpools'Class is
+ return access Root_Storage_Pool_With_Subpools'Class
+ is
begin
return Subpool.Owner;
end Pool_Of_Subpool;
procedure Set_Pool_Of_Subpool
(Subpool : not null Subpool_Handle;
- Pool : in out Root_Storage_Pool_With_Subpools'Class)
+ To : in out Root_Storage_Pool_With_Subpools'Class)
is
N_Ptr : SP_Node_Ptr;
-- Prevent the creation of a new subpool while the owner is being
-- finalized. This is a serious error.
- if Pool.Finalization_Started then
+ if To.Finalization_Started then
raise Program_Error
with "subpool creation after finalization started";
end if;
- Subpool.Owner := Pool'Unchecked_Access;
+ Subpool.Owner := To'Unchecked_Access;
-- Create a subpool node and decorate it. Since this node is not
-- allocated on the owner's pool, it must be explicitly destroyed by
N_Ptr.Subpool := Subpool;
Subpool.Node := N_Ptr;
- Attach (N_Ptr, Pool.Subpools'Unchecked_Access);
+ Attach (N_Ptr, To.Subpools'Unchecked_Access);
-- Mark the subpool's master as being a heterogeneous collection of
-- controlled objects.