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!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!feedme.ziplink.net!news.swapon.de!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Re: Using local storage pools... Date: Sat, 26 Feb 2011 12:41:50 +0100 Organization: A noiseless patient Spider Message-ID: <87mxljuio1.fsf@ludovic-brenta.org> References: <7elam6trrv39c3p9iop4fiduqa1jrat4r4@4ax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx01.eternal-september.org; posting-host="/DV156EFGZYtkluziQa4zA"; logging-data="13730"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/InovZzYFbiUrwUi0bTcJq" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) Cancel-Lock: sha1:xit9vrXoZkwIfsDBaKMh9PEOe98= sha1:A77hFxkbjq0LH3GF8N17ujtVUk4= Xref: g2news2.google.com comp.lang.ada:18586 Date: 2011-02-26T12:41:50+01:00 List-Id: anon@att.net writes: > 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. C does not have local pools; these are provided by the external Apache Portable Run-time Library which is not part of the language. Similarly, the C++ version uses the pools from the Boost library, which is not part of the language either. > 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. No, it doesn't, because the internal representation used by GCC is called GIMPLE, looks like LISP, is not specific to any one language, and can represent all of Ada's elegance. > 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. Are you assuming that Randy and the other members of the ARG are idiots who blindly repeat mistakes from other languages? If that were the case, Ada would not be 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. But Ada has pools *in the language* whereas C and C++ must rely on third-party libraries. And GNAT, specifically, provides local pools for just that purpose. And where did you get the notion that Brian was complaining about anything? > 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. Brian says he is trying to "learn a little about storage pools." Do you really think he can do a better job at designing storage pools than the ARG with their cumulated decades of experience? -- Ludovic Brenta.