Subj : Re: JS_AddRoot & finalize problem To : netscape.public.mozilla.jseng From : anton muhin Date : Fri Jul 23 2004 02:47 pm Hello, Brendan! Brendan Eich wrote: > Perhaps something was added to the array later? No. Proto is constructed and I immediatley leave jsshell session. > GC_MARK_DEBUG and js_liveThingToFind would tell the answer, if you're > willing to re-compile with the former defined, and set the latter at > runtime to point to the object (|obj| in your code shown last time) that > never gets collected. I beg your pardon for small correction in case someone else would read your postings: not |js_liveThingToFind|, but |js_LiveThingToFind| (at least in my version of the sources). I tried it and finished with: 003294a8 object 00000000 Array via root(Array) Here come questions: 003294a8---an address of created Array. 00000000---sources name it rootThing. Do I interpret it correctly as private data of the object that leaks, in this case an instance of Array? Array---obvious, class name root(Array)---I suppose it's a kind of a root dedicated to Array? Maybe the one I introduced with JS_AddRoot while constructing. If I trace my prototype object I got: 00329490 object 0042665C MFInt32 via root(Array).__proto__(Array).__proto__(Object).__parent__(global).MFInt32(Function).prototype(MFInt32). 00329490 object 0042665C MFInt32 via root(Array).__proto__(Array).__proto__(Object).__parent__(global).MFInt32(Function).prototype(MFInt32). toString(Function).__parent__(MFInt32). Couple of comments: toString is the only method I define for my MFInt32 class. I'd be wrong but it looks like that the prototype doesn't get collected as it has a pointer to rooted array as its *private* data. If it's so, I'm a little bit astonished, for it seems counter-intuitive to me. Is private-data slot treated differently by GC? with the best regards, anton. .