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
- 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 car of the cell.
- Apply the marking algorithm to the cdr of the cell.