[kaffe] Weak references/Class destruction

Timothy Stack stack at cs.utah.edu
Wed Dec 22 09:53:10 PST 2004


> Hi,
> 
> Here is a patch which changes the way the classes are destroyed and 
> implements
> weak references for boehm-gc and kaffe-gc. This fixes class concurrent
> destruction issues which was bugging boehm-gc (and maybe also kaffe-gc) and
> should insure that we do not access already freed memory.

Is there a more detailed description of this problem in the mail archive?  
Alas, I haven't been paying close enough attention, so a pointer would 
be nice ;)...

As for the patch, I'm not really clear what is going on with the weakrefs 
yet, but the portions that deal with gc'ing tramps and translated code 
look fine.  And, I think there is a small bug in the boehm-gc part of the 
patch, you define an empty static version of KaffeGC_*WeakRef in gc2.c:

  +static
  +bool
  +KaffeGC_addWeakRef(Collector *collector UNUSED, void* mem UNUSED, void **ref UNUSED)
  +{
  +}
  +

But there is also a real version in gc-refs.c, which might be ignored when 
filling out the GC vtable.  Or, maybe I'm just missing something...

> Guilhem Lavaux.

thanks,

tim



More information about the kaffe mailing list