[Gc] GC_base returns non null for a freed pointer

Boehm, Hans hans.boehm at hp.com
Tue Aug 17 10:20:14 PDT 2004


Just to clarify for the record, even though it's probably a moot point:

Part of the problem here is that there is normally no object
header which is reserved for the collector.  Mark bits are elsewhere.  Sizes are
not needed on a per object basis, since all objects in a (page-sized) block
have the same size.

If you use debug allocation, then there is space available for this sort of thing,
and the collector does try to keep track of such things in the header.

Hans

> -----Original Message-----
> From: Guilhem Lavaux [mailto:guilhem at kaffe.org]
> Sent: Tuesday, August 17, 2004 1:16 AM
> To: Hans Boehm
> Cc: gc at napali.hpl.hp.com
> Subject: Re: [Gc] GC_base returns non null for a freed pointer
> 
> 
> Hans Boehm wrote:
> 
> >This is normal.  It would be relatively expensive to do something
> >different without having GC_free store a magic number in 
> free objects,
> >or the like.  GC_free puts the object on a free list, but doesn't
> >otherwise label it.
> >
> >Is this a problem?  The current semantics have generally 
> been OK for what
> >I've needed.
> >
> >  
> >
> 
> Actually, I have tried this morning to pass through this 
> limitation and 
> it is very hard without changing the logic completely in kaffe. Is it 
> really difficult to add a flag in object header or invalidate 
> an object 
> in the freelist ? It could be possible to reclaim it 
> afterward just by 
> clearing it in GC_*_malloc.
> 
> >Hans
> >
> >On Mon, 16 Aug 2004, Guilhem Lavaux wrote:
> >
> >  
> >
> >>Hi,
> >>
> >>I have merged a kaffe interface to gc6.3 in the kaffe's CVS head and
> >>I've noticed that if I  free an object (using GC_free) 
> GC_base continues
> >>returning a non-null pointer. Is it the normal behaviour ?
> >>
> >>Regards,
> >>
> >>Guilhem Lavaux.
> >>
> >>P.S.: I have just subscribed to the mailing list so I 
> apologize if the
> >>question has already been asked.
> >>_______________________________________________
> >>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