[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-dev] Finalizers



On 11/27/06, Ryan Brown <ryan@xxxxxxxxx> wrote:
> It is working in general; the problem is it collects in between calls.

I figured out what the problem was; InstallFinalizer() calls GCWrite
() to make a reference between the object getting a finalizer and the
Finalizer object. GCWrite() checks that the parent (the object
getting a finalizer) is black, which it isn't because I had just
created it with instantiateObject() (in the case of .alloc at least).
The solution is to manually call toGrey() to force the reference.
Does this sound alright?

No, you have some other problem. GCWrite does not create a reference
and calling toGrey is not a fix.
When you call NewFinalizer is the collect argument true? If so make it
false. You don't want to
collect when you have an unreferenced object.


--
--- james mccartney