[Gc] Problems with GC_size_map

Boehm, Hans hans.boehm at hp.com
Fri Feb 5 17:22:27 PST 2010


> -----Original Message-----
> From: bruce.hoult at gmail.com [mailto:bruce.hoult at gmail.com] On 
> Behalf Of Bruce Hoult
> Sent: Tuesday, February 02, 2010 1:53 AM
> To: Juan Jose Garcia-Ripoll
> Cc: Boehm, Hans; gc at napali.hpl.hp.com
> Subject: Re: [Gc] Problems with GC_size_map
> On Tue, Feb 2, 2010 at 10:42 PM, Juan Jose Garcia-Ripoll 
> <juanjose.garciaripoll at googlemail.com> wrote:
> > On Tue, Feb 2, 2010 at 5:35 AM, Boehm, Hans 
> <hans.boehm at hp.com> wrote:
> >>
> >> You're using GC_MALLOC_WORDS in gc_inline.h?  The idea 
> here was that 
> >> you supply a freelist array that is used for fast inline 
> allocation 
> >> of small objects.  The fast path shouldn't access GC_arrays.  The 
> >> slow path uses function calls into the collector.  This 
> code is also 
> >> used by thread-local-allocation, but otherwise may not be 
> tremendously well tested.
> >
> > I have a stupid question. The tiny free list, does it have to be 
> > allocated as atomic or as ordinary? And from the header I 
> understood 
> > there is no need for locking and can be used for thread-local 
> > allocation of data that is shared by all threads. Is this correct?
> I would suspect that it should not be allocated by the GC at 
> all, but atomic uncollectible would be OK too.
The free list should be GC-visible.  It's essentially just a cache of small object free-lists that gets used first and refilled with GC_malloc_many is empty.  If you allocate it statically (one per thread with multiple threads), that should be fine.


More information about the Gc mailing list