
-- 1: --------------------------------
-- 2: -- Ivan Levashew aka OCTAGRAM --
-- 3: --              Barnaul, 2009 --
-- 4: --------------------------------

-- 5:

-- 6: with System; use System;

-- 7: with System.Storage_Pools; use System.Storage_Pools;

-- 8: with System.Storage_Elements;

-- 9:

-- 10: package Turbo_Private.Memory is
with turbo_private;
with system;
with system;
with system;
use system;
with system.system__storage_pools;
use system.system__storage_pools;
with system.system__storage_elements;
with ada.ada__tags;
with system;
with system.system__finalization_root;
with system.system__finalization_implementation;
with system.system__storage_elements;
turbo_private__memory_E : boolean := false;
package turbo_private.turbo_private__memory is

-- 11:    pragma Preelaborate;
   pragma preelaborate;

-- 12:

-- 13:    type Reallocable_Storage_Pool is abstract new Root_Storage_Pool
   type turbo_private__memory__reallocable_storage_pool is new
     system__storage_pools__root_storage_pool with private;

-- 14:       with private;
-- 15:    -- pragma Preelaborable_Initialization(Reallocable_Storage_Pool);
-- 16:    -- Q: Why did I commented this pragma out?
-- 17:    -- A: Because GNAT 2009 GPL RTL doesn't have
-- 18:    -- pragma Preelaborable_Initialization in s-stopoo.ads

-- 19:

-- 20:    procedure Reallocate (

-- 21:       Pool : in out Reallocable_Storage_Pool;

-- 22:       Storage_Address : in out Address;

-- 23:       Size_In_Storage_Elements, New_Size_In_Storage_Elements : in Storage_Elements.Storage_Count;

-- 24:       Alignment : in Storage_Elements.Storage_Count) is abstract;
   procedure turbo_private__memory__reallocate (pool : in out
     turbo_private__memory__reallocable_storage_pool; storage_address :
     in out system__address; size_in_storage_elements : in
     system__storage_elements.system__storage_elements__storage_count;
     new_size_in_storage_elements : in system__storage_elements.
     system__storage_elements__storage_count; alignment : in
     system__storage_elements.system__storage_elements__storage_count)
     is abstract;

-- 25:

-- 26:    type Turbo_Storage_Pool is abstract new Reallocable_Storage_Pool
   type turbo_private__memory__turbo_storage_pool is new
     turbo_private__memory__reallocable_storage_pool with private;

-- 27:       with private;
-- 28:    -- pragma Preelaborable_Initialization(Turbo_Storage_Pool);

-- 29:

-- 30:    procedure Deallocate (

-- 31:       Pool : in out Turbo_Storage_Pool;

-- 32:       Storage_Address : in Address) is abstract;
   procedure turbo_private__memory__deallocate__3 (pool : in out
     turbo_private__memory__turbo_storage_pool; storage_address : in
     system__address) is abstract;

-- 33:

-- 34:    procedure Reallocate (

-- 35:       Pool : in out Turbo_Storage_Pool;

-- 36:       Storage_Address : in out Address;

-- 37:       New_Size_In_Storage_Elements : in Storage_Elements.Storage_Count) is abstract;
   procedure turbo_private__memory__reallocate__3 (pool : in out
     turbo_private__memory__turbo_storage_pool; storage_address : in
     out system__address; new_size_in_storage_elements : in
     system__storage_elements.system__storage_elements__storage_count)
     is abstract;

-- 38:

-- 39: private
private

-- 40:

-- 41:    type Reallocable_Storage_Pool is abstract new Root_Storage_Pool
   type turbo_private__memory__reallocable_storage_pool is abstract
     new system__storage_pools__root_storage_pool with record
      _parent : system__storage_pools__root_storage_pool;
   end record;
   function turbo_private__memory___size__3 (x :
     turbo_private__memory__reallocable_storage_pool) return
     long_long_integer;
   function turbo_private__memory___alignment__3 (x :
     turbo_private__memory__reallocable_storage_pool) return integer;
   procedure turbo_private__memory__reallocable_storage_poolDF__2 (v :
     in out turbo_private__memory__reallocable_storage_pool; b :
     boolean);

-- 42:       with null record;

-- 43:

-- 44:    type Turbo_Storage_Pool is abstract new Reallocable_Storage_Pool
   freeze turbo_private__memory__reallocable_storage_pool [
      subtype turbo_private__memory__Treallocable_storage_poolTS is
        ada__tags__dispatch_table_wrapper (7);
      turbo_private__memory__reallocable_storage_poolT : aliased
        constant ada__tags__dispatch_table_wrapper (7);
      $pragma import (ada,
        turbo_private__memory__reallocable_storage_poolT, "turbo_private__memory__reallocable_storage_poolT");
      subtype turbo_private__memory__S2s is ada__tags__address_array (
        1 .. turbo_private__memory__reallocable_storage_poolT.num_prims);
      null;
      turbo_private__memory__reallocable_storage_poolP : static
        constant ada__tags__tag := ada__tags__tag!(
        turbo_private__memory__reallocable_storage_poolT.prims_ptr'
        address);
      turbo_private__memory__reallocable_storage_poolY : constant
        system__address :=
        turbo_private__memory__reallocable_storage_poolT.predef_prims'
        address;
      type turbo_private__memory__reallocable_storage_poolG is array (
        1 .. 7) of ada__tags__prim_ptr;
      type turbo_private__memory__reallocable_storage_poolH is access
        turbo_private__memory__reallocable_storage_poolG;
      freeze turbo_private__memory___size__3 []
      freeze turbo_private__memory___alignment__3 []
      freeze turbo_private__memory__reallocable_storage_poolDF__2 []
      procedure turbo_private__memory__reallocable_storage_poolIP (
        _init : in out turbo_private__memory__reallocable_storage_pool;
        P5s : boolean := true) is
      begin
         if P5s then
            _init._tag :=
              turbo_private__memory__reallocable_storage_poolP;
         end if;
         $system__storage_pools__root_storage_poolIP (_init._parent,
           false);
         return;
      end turbo_private__memory__reallocable_storage_poolIP;
      function turbo_private__memory___alignment (x :
        turbo_private__memory__reallocable_storage_pool) return integer is
      begin
         return x'alignment;
      end turbo_private__memory___alignment;
      function turbo_private__memory___size (x :
        turbo_private__memory__reallocable_storage_pool) return
        long_long_integer is
      begin
         return x'size;
      end turbo_private__memory___size;
      procedure turbo_private__memory__reallocable_storage_poolDF (v :
        in out turbo_private__memory__reallocable_storage_pool; b :
        boolean) is
      begin
         if b then
            $system__finalization_implementation__finalize_one (
              system__finalization_root__finalizable?(v));
         else
            $ada__finalization__finalize__2 (v);
         end if;
         return;
      end turbo_private__memory__reallocable_storage_poolDF;
   ]
   freeze turbo_private__memory__Treallocable_storage_poolC []
   type turbo_private__memory__turbo_storage_pool is abstract new
     turbo_private__memory__reallocable_storage_pool with record
      _parent : turbo_private__memory__reallocable_storage_pool;
   end record;
   function turbo_private__memory___size__4 (x :
     turbo_private__memory__turbo_storage_pool) return
     long_long_integer;
   function turbo_private__memory___alignment__4 (x :
     turbo_private__memory__turbo_storage_pool) return integer;
   procedure turbo_private__memory__turbo_storage_poolDF__2 (v : in
     out turbo_private__memory__turbo_storage_pool; b : boolean);
   freeze turbo_private__memory__turbo_storage_pool [
      subtype turbo_private__memory__Tturbo_storage_poolTS is
        ada__tags__dispatch_table_wrapper (9);
      turbo_private__memory__turbo_storage_poolT : aliased constant
        ada__tags__dispatch_table_wrapper (9);
      $pragma import (ada, turbo_private__memory__turbo_storage_poolT, "turbo_private__memory__turbo_storage_poolT");
      subtype turbo_private__memory__S9s is ada__tags__address_array (
        1 .. turbo_private__memory__turbo_storage_poolT.num_prims);
      null;
      turbo_private__memory__turbo_storage_poolP : static constant
        ada__tags__tag := ada__tags__tag!(
        turbo_private__memory__turbo_storage_poolT.prims_ptr'address);
      turbo_private__memory__turbo_storage_poolY : constant
        system__address := turbo_private__memory__turbo_storage_poolT.
        predef_prims'address;
      type turbo_private__memory__turbo_storage_poolG is array (1 ..
        9) of ada__tags__prim_ptr;
      type turbo_private__memory__turbo_storage_poolH is access
        turbo_private__memory__turbo_storage_poolG;
      freeze turbo_private__memory___size__4 []
      freeze turbo_private__memory___alignment__4 []
      freeze turbo_private__memory__turbo_storage_poolDF__2 []
      procedure turbo_private__memory__turbo_storage_poolIP (_init :
        in out turbo_private__memory__turbo_storage_pool; P12s :
        boolean := true) is
      begin
         if P12s then
            _init._tag := turbo_private__memory__turbo_storage_poolP;
         end if;
         turbo_private__memory__reallocable_storage_poolIP (_init.
           _parent, false);
         return;
      end turbo_private__memory__turbo_storage_poolIP;
      function turbo_private__memory___alignment (x :
        turbo_private__memory__turbo_storage_pool) return integer is
      begin
         return x'alignment;
      end turbo_private__memory___alignment;
      function turbo_private__memory___size (x :
        turbo_private__memory__turbo_storage_pool) return
        long_long_integer is
      begin
         return x'size;
      end turbo_private__memory___size;
      procedure turbo_private__memory__turbo_storage_poolDF (v : in
        out turbo_private__memory__turbo_storage_pool; b : boolean) is
      begin
         if b then
            $system__finalization_implementation__finalize_one (
              system__finalization_root__finalizable?(v));
         else
            $ada__finalization__finalize__2 (v);
         end if;
         return;
      end turbo_private__memory__turbo_storage_poolDF;
   ]
   freeze turbo_private__memory__Tturbo_storage_poolC []
   [type turbo_private__memory__Treallocable_storage_poolGB is array (
     1 .. 7 range <>) of ada__tags__prim_ptr]
   freeze turbo_private__memory__Treallocable_storage_poolGB []
   freeze turbo_private__memory__reallocable_storage_poolG []
   freeze turbo_private__memory__reallocable_storage_poolH []
   [type turbo_private__memory__Tturbo_storage_poolGB is array (1 ..
     9 range <>) of ada__tags__prim_ptr]
   freeze turbo_private__memory__Tturbo_storage_poolGB []
   freeze turbo_private__memory__turbo_storage_poolG []
   freeze turbo_private__memory__turbo_storage_poolH []
   subtype turbo_private__memory__Treallocable_storage_poolE16sS is
     string (1 .. 46);
   turbo_private__memory__reallocable_storage_poolE16s : static
     constant string (1 .. 46) :=
     "TURBO_PRIVATE.MEMORY.REALLOCABLE_STORAGE_POOL["00"]";
   turbo_private__memory__reallocable_storage_poolH17s : ada__tags__tag :=
     ada__tags__tag!(ada__tags__tag'(null));
   subtype turbo_private__memory__Treallocable_storage_poolB20sS is
     ada__tags__type_specific_data (4);
   [subtype turbo_private__memory__T29s is ada__tags__tag_table (0 ..
     4)]
   reference turbo_private__memory__T29s
   turbo_private__memory__reallocable_storage_poolB20s : static
     aliased constant ada__tags__type_specific_data (4) := (
      idepth => 4,
      access_level => 0,
      expanded_name => ada__tags__cstring_ptr!(
        turbo_private__memory__reallocable_storage_poolE16s'address),
      external_tag => ada__tags__cstring_ptr!(
        turbo_private__memory__reallocable_storage_poolE16s'address),
      ht_link => ada__tags__tag_ptr!(
        turbo_private__memory__reallocable_storage_poolH17s'address),
      transportable => false,
      rc_offset => 0,
      size_func => ada__tags__size_ptr!(turbo_private__memory___size__3'
        unrestricted_access),
      interfaces_table => null,
      ssd => null,
      tags_table => (turbo_private__memory__reallocable_storage_poolP,
        system__storage_pools__root_storage_poolP,
        ada__finalization__limited_controlledP,
        system__finalization_root__root_controlledP,
        system__finalization_root__empty_root_controlledP));
   for turbo_private__memory__reallocable_storage_poolB20s'alignment
     use 4;
   subtype turbo_private__memory__S21s is ada__tags__address_array;
   turbo_private__memory__reallocable_storage_poolR18s : static
   [subtype turbo_private__memory__T38s is ada__tags__address_array (
     1 .. 10)]
     aliased constant turbo_private__memory__T38s := (
     turbo_private__memory___size__3'unrestricted_access,
     turbo_private__memory___alignment__3'unrestricted_access,
     ada__finalization__limited_controlledSR__2'unrestricted_access,
     ada__finalization__limited_controlledSW__2'unrestricted_access,
     null, ada__finalization__limited_controlledSO__2'
     unrestricted_access, null, system__finalization_root___assign__2'
     unrestricted_access, null,
     turbo_private__memory__reallocable_storage_poolDF__2'
     unrestricted_access);
   for turbo_private__memory__reallocable_storage_poolR18s'alignment
     use 4;
   subtype turbo_private__memory__Treallocable_storage_poolT15sS is
     ada__tags__dispatch_table_wrapper (7);
   [subtype turbo_private__memory__T46s is ada__tags__address_array (
     1 .. 7)]
   reference turbo_private__memory__T46s
   turbo_private__memory__reallocable_storage_poolT : static aliased
     constant ada__tags__dispatch_table_wrapper (7) := (
      num_prims => 7,
      signature => ada__tags__primary_dt,
      tag_kind => ada__tags__tk_abstract_limited_tagged,
      predef_prims =>
        turbo_private__memory__reallocable_storage_poolR18s'address,
      offset_to_top => 0,
      tsd => turbo_private__memory__reallocable_storage_poolB20s'
        address,
      prims_ptr => (ada__finalization__initialize__2'
        unrestricted_access, ada__finalization__finalize__2'
        unrestricted_access, system__finalization_root__adjust'
        unrestricted_access, null, null, null, null));
   $pragma export (ada,
     turbo_private__memory__reallocable_storage_poolT, "turbo_private__memory__reallocable_storage_poolT");
   for turbo_private__memory__reallocable_storage_poolT'alignment use
     4;
   $ada__tags__register_tag (
     turbo_private__memory__reallocable_storage_poolP);
   subtype turbo_private__memory__Tturbo_storage_poolE48sS is string (
     1 .. 40);
   turbo_private__memory__turbo_storage_poolE48s : static constant
     string (1 .. 40) := "TURBO_PRIVATE.MEMORY.TURBO_STORAGE_POOL["00"]";
   turbo_private__memory__turbo_storage_poolH49s : ada__tags__tag :=
     ada__tags__tag!(ada__tags__tag'(null));
   subtype turbo_private__memory__Tturbo_storage_poolB52sS is
     ada__tags__type_specific_data (5);
   [subtype turbo_private__memory__T61s is ada__tags__tag_table (0 ..
     5)]
   reference turbo_private__memory__T61s
   turbo_private__memory__turbo_storage_poolB52s : static aliased
     constant ada__tags__type_specific_data (5) := (
      idepth => 5,
      access_level => 0,
      expanded_name => ada__tags__cstring_ptr!(
        turbo_private__memory__turbo_storage_poolE48s'address),
      external_tag => ada__tags__cstring_ptr!(
        turbo_private__memory__turbo_storage_poolE48s'address),
      ht_link => ada__tags__tag_ptr!(
        turbo_private__memory__turbo_storage_poolH49s'address),
      transportable => false,
      rc_offset => 0,
      size_func => ada__tags__size_ptr!(turbo_private__memory___size__4'
        unrestricted_access),
      interfaces_table => null,
      ssd => null,
      tags_table => (turbo_private__memory__turbo_storage_poolP,
        turbo_private__memory__reallocable_storage_poolP,
        system__storage_pools__root_storage_poolP,
        ada__finalization__limited_controlledP,
        system__finalization_root__root_controlledP,
        system__finalization_root__empty_root_controlledP));
   for turbo_private__memory__turbo_storage_poolB52s'alignment use
     4;
   subtype turbo_private__memory__S53s is ada__tags__address_array;
   turbo_private__memory__turbo_storage_poolR50s : static aliased
   [subtype turbo_private__memory__T70s is ada__tags__address_array (
     1 .. 10)]
     constant turbo_private__memory__T70s := (
     turbo_private__memory___size__4'unrestricted_access,
     turbo_private__memory___alignment__4'unrestricted_access,
     ada__finalization__limited_controlledSR__2'unrestricted_access,
     ada__finalization__limited_controlledSW__2'unrestricted_access,
     null, ada__finalization__limited_controlledSO__2'
     unrestricted_access, null, system__finalization_root___assign__2'
     unrestricted_access, null,
     turbo_private__memory__turbo_storage_poolDF__2'unrestricted_access);
   for turbo_private__memory__turbo_storage_poolR50s'alignment use
     4;
   subtype turbo_private__memory__Tturbo_storage_poolT47sS is
     ada__tags__dispatch_table_wrapper (9);
   [subtype turbo_private__memory__T78s is ada__tags__address_array (
     1 .. 9)]
   reference turbo_private__memory__T78s
   turbo_private__memory__turbo_storage_poolT : static aliased
     constant ada__tags__dispatch_table_wrapper (9) := (
      num_prims => 9,
      signature => ada__tags__primary_dt,
      tag_kind => ada__tags__tk_abstract_limited_tagged,
      predef_prims => turbo_private__memory__turbo_storage_poolR50s'
        address,
      offset_to_top => 0,
      tsd => turbo_private__memory__turbo_storage_poolB52s'address,
      prims_ptr => (ada__finalization__initialize__2'
        unrestricted_access, ada__finalization__finalize__2'
        unrestricted_access, system__finalization_root__adjust'
        unrestricted_access, null, null, null, null, null, null));
   $pragma export (ada, turbo_private__memory__turbo_storage_poolT, "turbo_private__memory__turbo_storage_poolT");
   for turbo_private__memory__turbo_storage_poolT'alignment use 4;
   $ada__tags__register_tag (turbo_private__memory__turbo_storage_poolP);
end turbo_private.turbo_private__memory;

-- 45:       with null record;

-- 46:

-- 47: end Turbo_Private.Memory;
