Skip to main content

Module gc

Module gc 

Source
Expand description

Mark-sweep garbage collection.

Spike 3 extends spike 2’s reachability rules with two new edges:

  1. From any Value::Object, every property value is reachable.
  2. From any Value::Object with Some(prototype), the prototype address is reachable.

Both edges are pure-functional traversals identical in shape to the reference edge: gather addresses into an immutable BTreeSet, then delegate sweeping to Heap::retain.

Functions§

collect
Retain only the cells reachable from roots and env.
reachable
Compute the set of addresses reachable from roots and env through heap.