5 \section{Garbage collection algorithm
}
7 \subsection{Operations on the roots
}
9 The $
\ms{minor
\_roots}$ array contains pointers to blocks in the major heap that
\emph{may
} contain
10 pointers into the minor heap. The
\thmtitle{Root invariant
}~
\ref{invariant:roots
} requires that
11 the root bit $R$ is set in the header of each block in $
\ms{minor
\_roots}$.
13 The $
\ms{clear
\_minor\_root}$ function deletes all entries in $
\ms{minor
\_roots}$, clearing the root
14 bits $R$ in the process.
16 \subsection{The mark phase
}
20 \subsection{Garbage collection
}
22 The garbage collector is called with five parameters:
25 \item the process context $
\ms{contextp
}$,
26 \item the number of heap bytes requested $
\ms{req
\_bytes}$,
27 \item the number of free entries in the pointer table requested $
\ms{req
\_pointers}$,
28 \item an array of values of the machine registers $
\ms{regs
}$,
29 \item and a bitmask of indicating which registers contain pointers.
32 The $
\ms{normalize
}$ function converts the value of each register that contain a pointer to its
33 corresponding index in the pointer table. The $
\ms{denormalize
}$ function does the reverse.
40 % TeX-command-default: "LaTeX/dvips Interactive"