comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: System.Pool_Local.Unbounded_Reclaim_Pool (Was: heap size exceeded for large matrices)
Date: Mon, 30 Aug 2010 15:38:55 +0200
Date: 2010-08-30T15:38:54+02:00	[thread overview]
Message-ID: <nhpk1phk60j.1c5toprawcky2$.dlg@40tude.net> (raw)
In-Reply-To: 87hbicgsor.fsf_-_@hugsarin.sparre-andersen.dk

On Mon, 30 Aug 2010 15:01:56 +0200, Jacob Sparre Andersen wrote:

> Cyrille <comar@eu.adacore.com> writes:
> 
>> If you want this behavior (i.e. deallocation of your dynamically
>> allocated object on scope exit) you can explicitly associate the local
>> access type to a pool object of type
>> System.Pool_Local.Unbounded_Reclaim_Pool.
> 
> Checking on Google indicates that this is a GNAT specific package.
> 
> Are there any special reasons that the RM doesn't include a collection
> of "useful" storage pool types like this one?

There is even more important thing about pools missing: there is no name
for the default storage pool.

Let I have some specialized pools, which serves the purpose of allocation
policy rather than actually providing storage. Such a pool sits on top of
another pool. E.g. a mark and release pool uses another pool to allocate
its blocks there. Other examples are stack pool, doubly-linked lists of
non-tagged elements, graphs etc.

The problem is that there is no way specify this default pool, because it
has no name. In order to get at it I need to use tricks like:

   type Integer_Access is access Integer;
       -- Hopefully it is the default pool

and then use Integer_Access'Storage_Pool. There is no any guaranty that
this would work.

P.S. It is clear that some compiler might use several default storage
pools, e.g. special pools for allocating objects of according to their
sizes. But that is no reason for not providing a default storage pool in
addition to them, which would work for any object.

P.P.S. There also should be a pragma or for-clause to re-route all other
default pools to some pool. E.g. to a debugging pool. GNAT has a debugging
pool but it is very difficult to use, because you have to rewrite all
declarations of specific access types. That should rather be:

   for System.Default_Pool use My_Debugging_Pool;

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  reply	other threads:[~2010-08-30 13:38 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-29  8:50 heap size exceeded for large matrices John Raymond Dore
2010-08-29  9:51 ` Yannick Duchêne (Hibou57)
2010-08-29 10:42   ` Simon Wright
2010-08-29 15:33     ` John Raymond Dore
2010-08-29 10:27 ` Pascal Obry
2010-08-29 15:14   ` Brian Drummond
2010-08-29 16:16     ` John Raymond Dore
2010-08-29 22:06       ` Peter C. Chapin
2010-08-29 22:47         ` Brian Drummond
2010-08-30  9:45           ` Brian Drummond
2010-08-30 11:04             ` Cyrille
2010-08-30 13:01               ` System.Pool_Local.Unbounded_Reclaim_Pool (Was: heap size exceeded for large matrices) Jacob Sparre Andersen
2010-08-30 13:38                 ` Dmitry A. Kazakov [this message]
2010-08-30 14:08                   ` Robert A Duff
2010-08-30 14:14                   ` J-P. Rosen
2010-08-30  7:44         ` heap size exceeded for large matrices Natasha Kerensikova
2010-08-30  9:41           ` Brian Drummond
2010-08-30  9:55             ` Natasha Kerensikova
2010-08-30  9:55           ` Dmitry A. Kazakov
2010-08-30 10:21             ` Georg Bauhaus
2010-08-30 18:56               ` Jeffrey Carter
2010-08-30 16:55             ` Simon Wright
2010-08-30 17:00               ` Robert A Duff
2010-08-30 19:51                 ` Simon Wright
2010-08-30 16:58           ` Simon Wright
2010-08-31 17:56             ` Natasha Kerensikova
2010-08-29 17:57     ` Pascal Obry
2010-08-29 15:35   ` John Raymond Dore
2010-08-29 17:57     ` Pascal Obry
2010-08-29 19:19       ` Ludovic Brenta
2010-08-29 20:33         ` Pascal Obry
2010-08-29 21:17           ` Robert A Duff
2010-08-29 21:29             ` Ludovic Brenta
replies disabled

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