comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Ada containers and custom allocators
Date: Thu, 10 Jan 2008 23:00:04 -0600
Date: 2008-01-10T23:00:04-06:00	[thread overview]
Message-ID: <fm8edk$qat$1@jacob-sparre.dk> (raw)
In-Reply-To: wcchchnc905.fsf@shell01.TheWorld.com

"Robert A Duff" <bobduff@shell01.TheWorld.com> wrote in message
news:wcchchnc905.fsf@shell01.TheWorld.com...
> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:
...
> > That always wondered me, why there is no name for. Especially because
the
> > default storage pool can be obtained anyway:
> >
> > type Some_Ptr is access Integer; -- Goes to the default storage pool
> > package Foo is new Boo (Some_Ptr'Storage_Pool);
>
> The compiler is not required to use the same storage pool for all
> types.  Therefore, the concept "THE default pool" does not exist.
>
> Some_Ptr'Storage_Pool might be a special pool tuned for the fact that
> Size_In_Storage_Elements = 4 and Alignment = 4.  Allocate could
> add 4 to a known-aligned pointer, and ignore the
> Size_In_Storage_Elements and Alignment parameters.
>
> If Boo uses this pool for something other than Integer,
> it might not work.

Right. And it turns out that some commonly used compilers actually do use
different pools in different circumstances. (I think the mechanism had to do
with the nesting level of the access type declaration; I recall that we
discussed it in detail.)

The net effect is that in some existing implementations, there is no general
pool. It didn't make much sense to force them to change to a more general
model that could introduce storage leaks in existing programs, and thus
there is (still) no name for the standard pool.

                          Randy.


> However, I see nothing wrong with having a predefined operation that
> returns a suitable pool.
>
> - Bob





  parent reply	other threads:[~2008-01-11  5:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-07 15:48 Ada containers and custom allocators Maciej Sobczak
2008-01-07 16:29 ` Dmitry A. Kazakov
2008-01-08  1:54 ` Randy Brukardt
2008-01-08  7:59   ` Maciej Sobczak
2008-01-08 23:54     ` Randy Brukardt
2008-01-09  8:56       ` Dmitry A. Kazakov
2008-01-09 15:29         ` Robert A Duff
2008-01-09 17:09           ` Dmitry A. Kazakov
2008-01-09 21:58             ` Robert A Duff
2008-01-10 10:12               ` Dmitry A. Kazakov
2008-01-11  5:00           ` Randy Brukardt [this message]
2008-01-09 15:28       ` Robert A Duff
2008-01-11  5:00         ` Randy Brukardt
2008-01-11 21:02           ` Maciej Sobczak
2008-01-11 22:41             ` Robert A Duff
2008-01-12 13:40               ` Maciej Sobczak
2008-01-12 15:59                 ` Robert A Duff
2008-01-09  1:17     ` Jeffrey R. Carter
replies disabled

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