--------------------------------
-- Ivan Levashew aka OCTAGRAM --
--              Barnaul, 2009 --
--------------------------------

with System; use System;
with System.Storage_Pools; use System.Storage_Pools;
with System.Storage_Elements;

package Turbo_Private.Memory is
   pragma Preelaborate;

   type Reallocable_Storage_Pool is abstract new Root_Storage_Pool
      with private;
   -- pragma Preelaborable_Initialization(Reallocable_Storage_Pool);
   -- Q: Why did I commented this pragma out?
   -- A: Because GNAT 2009 GPL RTL doesn't have
   -- pragma Preelaborable_Initialization in s-stopoo.ads

   procedure Reallocate (
      Pool : in out Reallocable_Storage_Pool;
      Storage_Address : in out Address;
      Size_In_Storage_Elements, New_Size_In_Storage_Elements : in Storage_Elements.Storage_Count;
      Alignment : in Storage_Elements.Storage_Count) is abstract;

   type Turbo_Storage_Pool is abstract new Reallocable_Storage_Pool
      with private;
   -- pragma Preelaborable_Initialization(Turbo_Storage_Pool);

   procedure Deallocate (
      Pool : in out Turbo_Storage_Pool;
      Storage_Address : in Address) is abstract;

   procedure Reallocate (
      Pool : in out Turbo_Storage_Pool;
      Storage_Address : in out Address;
      New_Size_In_Storage_Elements : in Storage_Elements.Storage_Count) is abstract;

private

   type Reallocable_Storage_Pool is abstract new Root_Storage_Pool
      with null record;

   type Turbo_Storage_Pool is abstract new Reallocable_Storage_Pool
      with null record;

end Turbo_Private.Memory;
