with System.Storage_Pools;
private with System;
private with System.Storage_Elements;
package Recycling_Pools is
pragma Elaborate_Body;
type Recycling_Pool is new System.Storage_Pools.Root_Storage_Pool with private;
private
use System;
protected type Simple_Lock is
entry Lock;
procedure Unlock;
private
unlocked : Boolean := True;
end Simple_Lock;
type Recycling_Pool is new System.Storage_Pools.Root_Storage_Pool with
record
used,
freed : System.Address := Null_Address;
lock : Simple_Lock;
end record;
procedure Allocate( this : in out Recycling_Pool;
address : out System.Address;
storageSize : System.Storage_Elements.Storage_Count;
alignment : System.Storage_Elements.Storage_Count );
procedure Deallocate( this : in out Recycling_Pool;
address : System.Address;
storageSize : System.Storage_Elements.Storage_Count;
alignment : System.Storage_Elements.Storage_Count );
procedure Finalize( this : in out Recycling_Pool );
function Storage_Size( this : Recycling_Pool ) return System.Storage_Elements.Storage_Count;
end Recycling_Pools;