[gclist] Precise GC's performance

fjh@cs.mu.OZ.AU fjh@cs.mu.OZ.AU
Tue, 5 Mar 1996 20:10:27 +1100 (EDT)


Darius Blasband, you wrote:
> 
> By the way, I have been looking to see how to integrate a conservative GC
> in YAFL and I found a potential problem: YAFL supports a user-redefinable
> KILL method, which is invoked before the object is deallocated. This method 
> is mainly used to free system resources (Widgets, pipes, etc...) attached to 
> YAFL objects when it is deallocated. Ultimately, the KILL method might even
> cancel the deallocation, by setting a valid reference to the object it is
> being applied to. One can say that KILL is an asynchronous destructor.
> 
> Does anyone have any idea on how to implement this KILL method on top of
> a conservative GC ? I guess it must be possible, but I don't know how.

The Boehm collector contains quite a bit of stuff to help you do this.
>From the README file:

| THE C INTERFACE TO THE ALLOCATOR
...
| 9) Several routines to allow for registration of finalization code.
|    User supplied finalization code may be invoked when an object becomes
|    unreachable.  To call (*f)(obj, x) when obj becomes inaccessible, use
| 	GC_register_finalizer(obj, f, x, 0, 0);
|    For more sophisticated uses, and for finalization ordering issues,
|    see gc.h.

-- 
Fergus Henderson             	WWW: http://www.cs.mu.oz.au/~fjh
fjh@cs.mu.oz.au              	PGP: finger fjh@128.250.37.3
"No Bad Religion song can make your life complete" -- Bad Religion.