[Vm-dev] Root flag & root objects
andreas.raab at gmx.de
Sat Feb 21 19:01:06 UTC 2009
Eliot Miranda wrote:
> So yes, when creating a new image, all objects are in oldSpace and so no
> objects need to be in the rot table or have their root bit set.
> This raises another point of ignorance for me. I would have thought
> that it is OK for the root bit to be set or the root table to contain
> objects that are not in old space or do not/no longer refer to objects
> in youngSpace because the GC will remove these from the root table on
> GC. But I don't see where objects get cleared from the rootTable. I
> only see the RootTable being voided when it gets full (rather drastic).
> Can anyone say if this happens or not, and if so, where it happens?
I think you're right. Short of a full GC the root table may never get
> Looks to me like either markAndTrace: or a specialized version, say
> markAndTraceRootObject:, should maintain a flag, refersToYoungObject,
> and clear the object from the rootTable (and clear the root bit)
> if refersToYoungObject is false at the end of the scan. But with the
> pointer reversal algorithm it is hard to see where to maintain this flag.
> Can those who know enlighten this ignorant soul?
> On Sat, Feb 21, 2009 at 4:42 AM, Igor Stasenko <siguctua at gmail.com
> <mailto:siguctua at gmail.com>> wrote:
> i'd like to ask, is it safe to clear the root flag for every object
> in system.
> I'm artificially creating a new image, and i'd like to know, what
> objects should be marked as roots initially, or VM can care about it
> Best regards,
> Igor Stasenko AKA sig.
More information about the Vm-dev