comp.lang.ada
 help / color / mirror / Atom feed
From: Ludovic Brenta <ludovic@ludovic-brenta.org>
Subject: Re: Using local storage pools...
Date: Sat, 26 Feb 2011 12:41:50 +0100
Date: 2011-02-26T12:41:50+01:00	[thread overview]
Message-ID: <87mxljuio1.fsf@ludovic-brenta.org> (raw)
In-Reply-To: ikaecb$bhb$1@speranza.aioe.org

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.



  parent reply	other threads:[~2011-02-26 11:41 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
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 [this message]
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