[m-dev.] Idea for reducing cost of heap allocation

Fergus Henderson fjh at cs.mu.OZ.AU
Fri May 4 07:15:30 AEST 2001


On 03-May-2001, Ralph Becket <rbeck at microsoft.com> wrote:
> Looking at the source, 
> GC_malloc_inner seems to perform quite a lot of work for each 
> call that would be common to all calls allocating the same cell 
> size.  You're right though, the overhead of calling GC_malloc
> inline with fixed arguments is minimal, providing the C compiler
> eliminates all the chaff in there.

The other relevant place to look is the code for GC_local_alloc(),
in boehm_gc/linux_threads.c.  This is new in recent versions of
the Boehm collector (and for the Mercury distribution is only on
the main branch, not in 0.10.*).  Currently we're not using it yet,
but we probably ought to, if multithreading is enabled.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list