Content deleted Content added
there are no objects on the stack that can be garbage collected -- only references. |
No edit summary |
||
Line 10:
Once all to-space references have been examined and updated, garbage collection is complete.
The very clever thing about this algorithm is that it needs no stack and very little memory outside of the from-space and to-space; it needs only a pointer to the beginning of free space in the to-space, and a pointer to the next word in to-space that needs to be examined
The aforementioned forwarding pointer (sometimes called a "broken heart") is used only during the garbage collection process: When a reference to an object already in to-space (thus having a forwarding pointer in from-space) is found, the reference can be updated quickly simply by updating its pointer to match the forwarding pointer.
|