Content deleted Content added
Phil Boswell (talk | contribs) →References: {{cite journal}} |
clarifying steps |
||
Line 2:
Cheney's algorithm reclaims items as follows:
* '''Objects on the stack.''' Object references on the stack are checked, and one of the two following actions is taken for each one:
** If the object has not yet been moved to the to-space, this is done by creating an identical copy in the to-space, and then replacing the from-space version with a forwarding pointer to the to-space copy. Then update the object reference to refer to the new version in to-space.
** If the object has already been moved to the to-space, simply update the reference from the forwarding pointer in from-space.
* '''Objects referenced by objects on the stack.''' Once this has been done, the garbage collector examines all object references in the objects that have been migrated to the to-space, and performs one of the above two actions on the referenced object.
==References==
|