[Gc] Crash in collector after adjusting root set

Boehm, Hans hans.boehm at hp.com
Mon Jun 19 17:39:25 PDT 2006


Presumably you meant GC_MALLOC_UNCOLLECTABLE?

I agree that if that's possible, that's a much better choice. 

Hans

> -----Original Message-----
> From: gc-bounces at napali.hpl.hp.com 
> [mailto:gc-bounces at napali.hpl.hp.com] On Behalf Of MenTaLguY
> Sent: Monday, June 19, 2006 5:29 PM
> To: Laurynas Biveinis
> Cc: gc at napali.hpl.hp.com
> Subject: Re: [Gc] Crash in collector after adjusting root set
> 
> On Sun, 2006-06-18 at 14:25 +0200, Laurynas Biveinis wrote:
> > Hi,
> > 
> > I'm experimenting with Boehm's GC as a garbage collector for GCC.
> > Since not whole memory is managed by GC, I have to take care to 
> > register additional roots living in malloc'ed memory with 
> > GC_add_roots(). Majority of them are constant during 
> program lifetime.
> > However there is a malloc'ed hash table of identifiers that may get 
> > moved for expansion. If it moves I try to adjust 
> collector's idea of 
> > root set by calling GC_remove_roots() for the old table and 
> > registering the new roots with GC_add_roots(). I've checked with 
> > GC_dump that after this collector has the correct set of roots.
> 
> Personally, I have found allocating such structures with
> GC_MALLOC_ATOMIC() useful, rather than registering them as GC 
> roots directly.
> 
> -mental
> 
> 
> _______________________________________________
> Gc mailing list
> Gc at linux.hpl.hp.com
> http://www.hpl.hp.com/hosted/linux/mail-archives/gc/
> 



More information about the Gc mailing list