Contents
Page-10
Prev
Next
Page+10
Index
Mark-And-Sweep Garbage Collection
Mark-and-sweep garbage collection first
marks all storage cells that
are in use, then sweeps up all unmarked cells. Symbol cells are marked,
and all pointers from the symbols are followed using the following
recursive algorithm:
- If the pointer points to a Symbol or to a marked cell, do nothing.
- Otherwise (pointer points to a cons Cell),
- Mark the cell itself.
- Apply the marking algorithm to the first of the cell.
- Apply the marking algorithm to the rest of the cell.