| 1 |
281 |
jeremybenn |
------------------------------------------------------------------------------
|
| 2 |
|
|
-- --
|
| 3 |
|
|
-- GNAT COMPILER COMPONENTS --
|
| 4 |
|
|
-- --
|
| 5 |
|
|
-- S Y S T E M . S T O R A G E _ P O O L S --
|
| 6 |
|
|
-- --
|
| 7 |
|
|
-- S p e c --
|
| 8 |
|
|
-- --
|
| 9 |
|
|
-- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
|
| 10 |
|
|
-- --
|
| 11 |
|
|
-- This specification is derived from the Ada Reference Manual for use with --
|
| 12 |
|
|
-- GNAT. The copyright notice above, and the license provisions that follow --
|
| 13 |
|
|
-- apply solely to the contents of the part following the private keyword. --
|
| 14 |
|
|
-- --
|
| 15 |
|
|
-- GNAT is free software; you can redistribute it and/or modify it under --
|
| 16 |
|
|
-- terms of the GNU General Public License as published by the Free Soft- --
|
| 17 |
|
|
-- ware Foundation; either version 3, or (at your option) any later ver- --
|
| 18 |
|
|
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
|
| 19 |
|
|
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
|
| 20 |
|
|
-- or FITNESS FOR A PARTICULAR PURPOSE. --
|
| 21 |
|
|
-- --
|
| 22 |
|
|
-- As a special exception under Section 7 of GPL version 3, you are granted --
|
| 23 |
|
|
-- additional permissions described in the GCC Runtime Library Exception, --
|
| 24 |
|
|
-- version 3.1, as published by the Free Software Foundation. --
|
| 25 |
|
|
-- --
|
| 26 |
|
|
-- You should have received a copy of the GNU General Public License and --
|
| 27 |
|
|
-- a copy of the GCC Runtime Library Exception along with this program; --
|
| 28 |
|
|
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
|
| 29 |
|
|
-- <http://www.gnu.org/licenses/>. --
|
| 30 |
|
|
-- --
|
| 31 |
|
|
-- GNAT was originally developed by the GNAT team at New York University. --
|
| 32 |
|
|
-- Extensive contributions were provided by Ada Core Technologies Inc. --
|
| 33 |
|
|
-- --
|
| 34 |
|
|
------------------------------------------------------------------------------
|
| 35 |
|
|
|
| 36 |
|
|
with Ada.Finalization;
|
| 37 |
|
|
with System.Storage_Elements;
|
| 38 |
|
|
|
| 39 |
|
|
package System.Storage_Pools is
|
| 40 |
|
|
pragma Preelaborate;
|
| 41 |
|
|
|
| 42 |
|
|
type Root_Storage_Pool is abstract
|
| 43 |
|
|
new Ada.Finalization.Limited_Controlled with private;
|
| 44 |
|
|
|
| 45 |
|
|
procedure Allocate
|
| 46 |
|
|
(Pool : in out Root_Storage_Pool;
|
| 47 |
|
|
Storage_Address : out Address;
|
| 48 |
|
|
Size_In_Storage_Elements : System.Storage_Elements.Storage_Count;
|
| 49 |
|
|
Alignment : System.Storage_Elements.Storage_Count)
|
| 50 |
|
|
is abstract;
|
| 51 |
|
|
|
| 52 |
|
|
procedure Deallocate
|
| 53 |
|
|
(Pool : in out Root_Storage_Pool;
|
| 54 |
|
|
Storage_Address : Address;
|
| 55 |
|
|
Size_In_Storage_Elements : System.Storage_Elements.Storage_Count;
|
| 56 |
|
|
Alignment : System.Storage_Elements.Storage_Count)
|
| 57 |
|
|
is abstract;
|
| 58 |
|
|
|
| 59 |
|
|
function Storage_Size
|
| 60 |
|
|
(Pool : Root_Storage_Pool)
|
| 61 |
|
|
return System.Storage_Elements.Storage_Count
|
| 62 |
|
|
is abstract;
|
| 63 |
|
|
|
| 64 |
|
|
private
|
| 65 |
|
|
-- The following two procedures support the use of class-wide pool
|
| 66 |
|
|
-- objects in storage pools. When a local type is given a class-wide
|
| 67 |
|
|
-- storage pool, allocation and deallocation for the type must dispatch
|
| 68 |
|
|
-- to the operation of the specific pool, which is achieved by a call
|
| 69 |
|
|
-- to these procedures. (When the pool type is specific, the back-end
|
| 70 |
|
|
-- generates a call to the statically identified operation of the type).
|
| 71 |
|
|
|
| 72 |
|
|
procedure Allocate_Any
|
| 73 |
|
|
(Pool : in out Root_Storage_Pool'Class;
|
| 74 |
|
|
Storage_Address : out Address;
|
| 75 |
|
|
Size_In_Storage_Elements : System.Storage_Elements.Storage_Count;
|
| 76 |
|
|
Alignment : System.Storage_Elements.Storage_Count);
|
| 77 |
|
|
|
| 78 |
|
|
procedure Deallocate_Any
|
| 79 |
|
|
(Pool : in out Root_Storage_Pool'Class;
|
| 80 |
|
|
Storage_Address : Address;
|
| 81 |
|
|
Size_In_Storage_Elements : System.Storage_Elements.Storage_Count;
|
| 82 |
|
|
Alignment : System.Storage_Elements.Storage_Count);
|
| 83 |
|
|
|
| 84 |
|
|
type Root_Storage_Pool is abstract
|
| 85 |
|
|
new Ada.Finalization.Limited_Controlled with null record;
|
| 86 |
|
|
end System.Storage_Pools;
|