Legacy Storage Pools (GNAT Reference Manual)

#### 17.3.3.3 Legacy Storage Pools ¶

Legacy Storage Pools are now replaced by a Storage_Model_Type. They are implemented as follows:

    type Root_Storage_Pool is abstract
      new Ada.Finalization.Limited_Controlled with private
    with Storage_Model_Type => (
       Allocate     => Allocate,
       Deallocate   => Deallocate,
       Storage_Size => Storage_Size
    );
    pragma Preelaborable_Initialization (Root_Storage_Pool);

    procedure Allocate
      (Pool                     : in out Root_Storage_Pool;
       Storage_Address          : out System.Address;
       Size_In_Storage_Elements : System.Storage_Elements.Storage_Count;
       Alignment                : System.Storage_Elements.Storage_Count)
    is abstract;

    procedure Deallocate
      (Pool                     : in out Root_Storage_Pool;
       Storage_Address          : System.Address;
       Size_In_Storage_Elements : System.Storage_Elements.Storage_Count;
       Alignment                : System.Storage_Elements.Storage_Count)
    is abstract;

    function Storage_Size
      (Pool : Root_Storage_Pool)
       return System.Storage_Elements.Storage_Count
    is abstract;

The legacy notation:

    type My_Pools is new Root_Storage_Pool with record [...]

    My_Pool_Instance : Storage_Model_Pool.Storage_Model :=
       My_Pools'(others => <>);

    type Acc is access Integer_Array with Storage_Pool => My_Pool;

can still be accepted as a shortcut for the new syntax.