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=-0.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, REPLYTO_WITHOUT_TO_CC autolearn=no 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: g2news1.google.com!news3.google.com!feeder.news-service.com!94.75.214.39.MISMATCH!aioe.org!.POSTED!not-for-mail From: anon@att.net Newsgroups: comp.lang.ada Subject: Re: Using local storage pools... Date: Sat, 26 Feb 2011 08:41:49 +0000 (UTC) Organization: Aioe.org NNTP Server Message-ID: References: <7elam6trrv39c3p9iop4fiduqa1jrat4r4@4ax.com> Reply-To: anon@anon.org NNTP-Posting-Host: h1bG2Aha4cZrjwX7W2OplQ.user.speranza.aioe.org X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: IBM NewsReader/2 2.0 Xref: g2news1.google.com comp.lang.ada:17613 Date: 2011-02-26T08:41:49+00:00 List-Id: In <7elam6trrv39c3p9iop4fiduqa1jrat4r4@4ax.com>, Brian Drummond writes: >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. > >http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gnat_ugn_unw/Some-Useful-Memory-Pools.html >suggests System.Pool_Local offers a way to do likewise - a pool that is >automatically reclaimed when it goes out of scope. > Every language has it pluses and minuses, this includes both C and Ada. As for storage pools there are reasons to have a global and others to use local routines. Just because C has local pools is no reason for Ada to have this type of pool. And as for using reasons stated by GNU which GNAT uses as it backend may not be valid for Ada. Plus, GNAT in converting Ada to the GNU C/C++ internal language, GNAT loses some of it elegant of Ada. So, Ada 2012 may have some local pools, based on the C code design that is "wrong for Ada", which may cause more harm than any additional to the use of Ada. If you want local pools then design and create your own package routines for your application instead of complaining that Ada should have it because C/C++ has it. And it could be a good tools for learning both Ada and the usage of storage pools. That way you can adjust the package to your needs instead of having to re-write your code to fit within the newly design ARG packages. Plus if your design is better than C or the ARG package you could even submit it the ARG and it might be an alternative or replacement for the initial ARG local storage pool package.