comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Using local storage pools...
Date: Fri, 25 Feb 2011 21:02:34 -0600
Date: 2011-02-25T21:02:34-06:00	[thread overview]
Message-ID: <ik9qge$9nu$1@munin.nbi.dk> (raw)
In-Reply-To: 7elam6trrv39c3p9iop4fiduqa1jrat4r4@4ax.com

"Brian Drummond" <brian_drummond@btconnect.com> wrote in message 
news:7elam6trrv39c3p9iop4fiduqa1jrat4r4@4ax.com...
>I am trying to learn a little about storage pools, with a view to 
>(hopefully)
> using local pools to improve the Binary_Trees benchmark in the same way as 
> some
> of the faster C benchmarks.
>
> Arguably they cheat : they do not explicitly free each tree node (the 
> "free"
> call has been deleted!) but free the entire pool at the end of the loop.
> But if that's valid, Ada should be able to do the same.

This sounds like a job for Ada 2012 subpools. Of course, to use them, you 
have to have an Ada 2012 compiler (and I don't think there is an 
implementation at the moment - we [the ARG] just approved the AI last week).

If the pools are completely disjoint and you can live with local access 
types, you can use individual local pool objects to do the job, but that 
typically isn't the case in practice.

You can write a pool to do mass deallocations, but such a pool is always 
erroneous according to the language (both Ada 95 and Ada 2005), so there can 
be no guarentee that it will work on another compiler. [Bob Duff will tell 
you that the intent was such things would work, and they often will - as 
compilers don't try to do bad things unless there is a good reason - but the 
language doesn't provide any help.]

                                                Randy. 





  parent reply	other threads:[~2011-02-26  3:02 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-23 19:01 Using local storage pools Brian Drummond
2011-02-23 20:42 ` Dmitry A. Kazakov
2011-02-23 23:55   ` Brian Drummond
2011-02-24  9:26     ` Dmitry A. Kazakov
2011-02-24  9:51       ` Georg Bauhaus
2011-02-24 10:09         ` Dmitry A. Kazakov
2011-02-24 10:39         ` Brian Drummond
2011-02-23 20:51 ` Ludovic Brenta
2011-02-24  0:27   ` Brian Drummond
2011-02-24  8:03     ` Ludovic Brenta
2011-02-24 17:04       ` Brian Drummond
2011-02-24 12:34     ` Robert A Duff
2011-02-23 21:01 ` Simon Wright
2011-02-24  0:00   ` Brian Drummond
2011-02-26  3:02 ` Randy Brukardt [this message]
2011-02-26 18:41   ` Pascal Obry
2011-02-26 18:59     ` Pascal Obry
2011-02-26  3:07 ` Randy Brukardt
2011-02-26  8:41 ` anon
2011-02-26 10:42   ` Pascal Obry
2011-02-26 11:41   ` Ludovic Brenta
2011-02-27  4:16     ` anon
2011-02-27  8:18       ` Pascal Obry
2011-02-27 23:46         ` Georg Bauhaus
replies disabled

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