Hacker News new | past | comments | ask | show | jobs | submit login

Okay, so you can precisely identify all objects pointed-to by roots on the stack or in registers, but you can't identify all such roots so you can update them. From what you describe, mostly-copying collection is perfect for your use-case.

Basically, mostly-copying collection allows you to perform copying collection in a situation where certain objects cannot be moved. The original use case was for conservative stack scanning. In that situation, you cannot move objects pointed-to by an ambiguous root because you cannot ensure it is an actual root. So while you're scanning the root set, you're "promoting" the target objects to to-space instead of copying them into to-space. But the mechanism is more general than just conservative root scanning. E.g. I'm using it because I need to keep potentially global objects from being moved during a local collection.

In your case, you would walk the stack/register roots precisely using maps, but promote target objects to-space rather than copying them, so derived pointers would not have to be updated. Then you could copy the remaining objects.

EDIT: David Detlef's PhD thesis contains a pretty good description of the algorithm (starting on pg. 16): http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.38....




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: