------- Additional Comments From ovidr at users dot sourceforge dot net 2005-06-20 16:25 ------- I've tried to create a testcase but can't seem to get a crash or infinite loop lockup.
Anyway, I think I understand conceptually what must be done, but in practice I'm still unsure of how to go about it. You don't seem to have a problem with the call to: _Jv_RegisterFinalizer (this, finalize_reference); only _Jv_RegisterFinalizer (referent, finalize_referred_to_object); but since referent is an arbitrary object, what kind of finalizers can it already have? I'm stumped on how to get access to an arbitrary object's finalizers from natReference.cc. Is it just the heavy_lock structure from natObject that needs to be considered somehow? >From comment #10: "My impression is that natReference.cc already keeps a fairly elaborate data structure to which you should be able to add the prior finalization info" This is the part that confuses me. Not all objects are References, so how would a Reference know about some arbitrary Object's previous finalizers or even attempt to maintain a data structure? And once I have the Object's old finalizer (if there is one), I guess I just run it, and register the new one with "GC_REGISTER_FINALIZER_NO_ORDER(x, x, cd, 0, 0);" from natReference's "finalize_referred_to_object" ? Or am I way off track? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18266