comp.lang.ada
 help / color / mirror / Atom feed
* Storage Pool
@ 2001-06-13 19:25 ANH_VO
  2001-06-13 22:55 ` Robert A Duff
  2001-06-15  1:02 ` Randy Brukardt
  0 siblings, 2 replies; 3+ messages in thread
From: ANH_VO @ 2001-06-13 19:25 UTC (permalink / raw)
  To: comp.lang.ada

Is it correct to assume that Size_In_Storage_Element mod Alignment = 0 for both
subprograms Allocate and Deallocate for any type derived from Root_Storage_Pool
as shown below

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

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

   where type General_Pool (Size : System.Storage_Elements.Storage_Count;
                            User : access String ) is new
                       System.Storage_Pools.Root_Storage_Pool with private;
   ...

   or is it compiler dependent?
   
   Thanks.

   Anh Vo



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Storage Pool
  2001-06-13 19:25 Storage Pool ANH_VO
@ 2001-06-13 22:55 ` Robert A Duff
  2001-06-15  1:02 ` Randy Brukardt
  1 sibling, 0 replies; 3+ messages in thread
From: Robert A Duff @ 2001-06-13 22:55 UTC (permalink / raw)


ANH_VO@udlp.com writes:

> Is it correct to assume that Size_In_Storage_Element mod Alignment = 0 for both
> subprograms Allocate and Deallocate for any type derived from Root_Storage_Pool
> as shown below

No.  But you can write a storage pool that requires that, and only use
it for types that obey that rule.

I have written storage pools that assume Alignment = 4 (and
pragma-assert so).

- Bob



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Storage Pool
  2001-06-13 19:25 Storage Pool ANH_VO
  2001-06-13 22:55 ` Robert A Duff
@ 2001-06-15  1:02 ` Randy Brukardt
  1 sibling, 0 replies; 3+ messages in thread
From: Randy Brukardt @ 2001-06-15  1:02 UTC (permalink / raw)


ANH_VO@udlp.com wrote in message ...
>Is it correct to assume that Size_In_Storage_Element mod Alignment = 0
for both
>subprograms Allocate and Deallocate for any type derived from
Root_Storage_Pool
>as shown below


I don't think you should assume anything not required by the reference
manual. And certainly this is not required by the reference manual.
Unless you want your code to work only with a particular implementation.


         Randy.


GNAT /= Ada 95







^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-06-15  1:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-13 19:25 Storage Pool ANH_VO
2001-06-13 22:55 ` Robert A Duff
2001-06-15  1:02 ` Randy Brukardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox