Import Upstream version 20180207
[hcoop/debian/mlton.git] / doc / guide / src / Reachability.adoc
1 Reachability
2 ============
3
4 Reachability is a notion dealing with the graph of heap objects
5 maintained at runtime. Nodes in the graph are heap objects and edges
6 correspond to the pointers between heap objects. As the program runs,
7 it allocates new objects (adds nodes to the graph), and those new
8 objects can contain pointers to other objects (new edges in the
9 graph). If the program uses mutable objects (refs or arrays), it can
10 also change edges in the graph.
11
12 At any time, the program has access to some finite set of _root_
13 nodes, and can only ever access nodes that are reachable by following
14 edges from these root nodes. Nodes that are _unreachable_ can be
15 garbage collected.
16
17 == Also see ==
18
19 * <:MLtonFinalizable:>
20 * <:MLtonWeak:>