comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Q: Creating my own storage pools
Date: Tue, 21 Jan 2003 19:33:49 GMT
Date: 2003-01-21T19:33:49+00:00	[thread overview]
Message-ID: <wcc7kcy8fhe.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: 3e2cc50a$0$33931$bed64819@news.gradwell.net

porton@ex-code.com (Victor Porton) writes:

> 13.11.20. "The effect of calling Allocate and Deallocate for a standard
> storage pool directly (rather than implicitly via an allocator or an
> instance of Unchecked_Deallocation) is unspecified."
> 
> I want to use the standard storage pool for allocating memory for my
> own portable storage pool. But how to allocate from the standard pool
> the given number of storage elements?

Use "new" on a type with no "for T'Storage_Pool use...".

>... Should I use packed arrays?

I don't think packing has anything to do with it.

> Also how to deal with alignment of the allocated memory?

Say "for T'Alignment use ..." on the type that is being new-ed.
This is probably an array of bytes or array of words or some
such thing, and your pool is allocating individual pieces of those
chunks.

- Bob



      parent reply	other threads:[~2003-01-21 19:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-21  3:56 Q: Creating my own storage pools Victor Porton
2003-01-21 15:10 ` Stephen Leake
2003-01-21 19:33 ` Robert A Duff [this message]
replies disabled

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