Our garbage collection algorithm uses a small-step semantics,
where one step (atomically) copies a single location. A full garbage
collection will therefore involve many individual steps, which
can be freely interleaved with evaluation or collection on other
processors. Figure 12 gives the transition rules for collection. Rule
HGC-StartGC locks the task for collection and sets up the tuple
by using the existing heap, H, as the from-heap, initializing the
to-heap and the forwarding map to be empty and the scan set to
be FL(e), the roots of the expression. Rule HGC-Copy performs
one step of collection. The rule takes a location from S which is
present in Hf , copies its value v, and adds to S the locations of v
which have not already been copied. Rule HGC-EndGC requires
that dom(Hf ) S = ;, i.e. that there are no remaining locations
to be collected. If this is the case, e is unlocked and the to-heap
becomes the new heap.