From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ed3a51e96a1c868b X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!news.in2p3.fr!in2p3.fr!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Using local storage pools... Date: Fri, 25 Feb 2011 21:02:34 -0600 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <7elam6trrv39c3p9iop4fiduqa1jrat4r4@4ax.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1298689358 9982 69.95.181.76 (26 Feb 2011 03:02:38 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Sat, 26 Feb 2011 03:02:38 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5931 X-RFC2646: Format=Flowed; Original Xref: g2news2.google.com comp.lang.ada:18579 Date: 2011-02-25T21:02:34-06:00 List-Id: "Brian Drummond" 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.