~ubuntu-branches/debian/stretch/adabrowse/stretch

« back to all changes in this revision

Viewing changes to gal-storage-default.ads

  • Committer: Bazaar Package Importer
  • Author(s): Ludovic Brenta
  • Date: 2004-02-14 13:22:40 UTC
  • Revision ID: james.westby@ubuntu.com-20040214132240-cqumhiq1677pkvzo
Tags: upstream-4.0.2
ImportĀ upstreamĀ versionĀ 4.0.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
-------------------------------------------------------------------------------
 
2
--
 
3
-- <STRONG>Copyright (c) 2001, 2002 by Thomas Wolf.</STRONG>
 
4
-- <BLOCKQUOTE>
 
5
--    This piece of software is free software; you can redistribute it and/or
 
6
--    modify it under the terms of the  GNU General Public License as published
 
7
--    by the Free Software  Foundation; either version 2, or (at your option)
 
8
--    any later version. This unit is distributed in the hope that it will be
 
9
--    useful, but <EM>without any warranty</EM>; without even the implied
 
10
--    warranty of <EM>merchantability or fitness for a particular purpose.</EM>
 
11
--    See the GNU General Public License for  more details. You should have
 
12
--    received a copy of the GNU General Public License with this distribution,
 
13
--    see file "<A HREF="GPL.txt">GPL.txt</A>". If not, write to the Free
 
14
--    Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
 
15
--    USA.
 
16
-- </BLOCKQUOTE>
 
17
-- <BLOCKQUOTE>
 
18
--   As a special exception from the GPL, if other files instantiate generics
 
19
--   from this unit, or you link this unit with other files to produce an
 
20
--   executable, this unit does not by itself cause the resulting executable
 
21
--   to be covered by the GPL. This exception does not however invalidate any
 
22
--   other reasons why the executable file might be covered by the GPL.
 
23
-- </BLOCKQUOTE>
 
24
--
 
25
-- <DL><DT><STRONG>
 
26
-- Author:</STRONG><DD>
 
27
--   Thomas Wolf  (TW)
 
28
--   <ADDRESS><A HREF="mailto:twolf@acm.org">twolf@acm.org</A></ADDRESS></DL>
 
29
--
 
30
-- <DL><DT><STRONG>
 
31
-- Purpose:</STRONG><DD>
 
32
--   A default storage pool that uses the pool of an arbitrary
 
33
--   access-to-integer type.</DL>
 
34
--
 
35
-- <DL><DT><STRONG>
 
36
-- Tasking semantics:</STRONG><DD>
 
37
--   As all pools, fully task safe.</DL>
 
38
--
 
39
-- <DL><DT><STRONG>
 
40
-- Storage semantics:</STRONG><DD>
 
41
--   It's a <EM>storage pool</EM>, so of course it does dynamic storage
 
42
--   allocations and deallocations.</DL>
 
43
--
 
44
-- <!--
 
45
-- Revision History
 
46
--
 
47
--   27-NOV-2001   TW  Initial version.
 
48
--   28-APR-2003   TW  Removed the Pool variable that was formerly used to
 
49
--                     instantiate GAL.Storage.Standard.
 
50
-- -->
 
51
-------------------------------------------------------------------------------
 
52
 
 
53
pragma License (Modified_GPL);
 
54
 
 
55
with System.Storage_Pools;
 
56
with System.Storage_Elements;
 
57
 
 
58
package GAL.Storage.Default is
 
59
 
 
60
   pragma Elaborate_Body;
 
61
 
 
62
   type Manager is
 
63
     new System.Storage_Pools.Root_Storage_Pool with null record;
 
64
   --  A plain vanilla pool that is the same as the pool for an access-to-
 
65
   --  integer type. Note that it is entirely implementation-defined whether
 
66
   --  one may use this pool for other types as well.
 
67
   --
 
68
   --  (Ada 95 *is* lacking a standardized feature to somehow define a
 
69
   --  "default" storage pool which, when given in a representation clause,
 
70
   --  would effectively make the system use whatever pool it'd use if there
 
71
   --  was no representation clause. It turns out that GNAT at least seems to
 
72
   --  use one pool for all types, so using 'Standard_Pool' below for the
 
73
   --  instantiations of the container packages works all right.)
 
74
 
 
75
   procedure Allocate
 
76
     (Pool            : in out Manager;
 
77
      Storage_Address :    out System.Address;
 
78
      Size            : in     System.Storage_Elements.Storage_Count;
 
79
      Alignment       : in     System.Storage_Elements.Storage_Count);
 
80
 
 
81
   procedure Deallocate
 
82
     (Pool            : in out Manager;
 
83
      Storage_Address : in     System.Address;
 
84
      Size            : in     System.Storage_Elements.Storage_Count;
 
85
      Alignment       : in     System.Storage_Elements.Storage_Count);
 
86
 
 
87
   function Storage_Size
 
88
     (Pool : in Manager)
 
89
     return System.Storage_Elements.Storage_Count;
 
90
 
 
91
end GAL.Storage.Default;