[project @ 1999-02-01 10:19:02 by simonm]
authorsimonm <unknown>
Mon, 1 Feb 1999 10:19:02 +0000 (10:19 +0000)
committersimonm <unknown>
Mon, 1 Feb 1999 10:19:02 +0000 (10:19 +0000)
Clarification about the root set and top-level objects for the
reachability property.

ghc/docs/libraries/Weak.sgml

index bc88b04..0f223f4 100644 (file)
@@ -215,6 +215,7 @@ follows
 A heap object is reachable if:
 
 <itemize>
+<item> It is a member of the <em/root set/.
 <item> It is directly pointed to by a reachable object, other than
 a weak pointer object.
 <item> It is a weak pointer object whose key is reachable.
@@ -222,6 +223,14 @@ a weak pointer object.
 reachable.
 </itemize>
 
+The root set consists of all runnable threads, and all stable pointers
+(see Section <ref id="sec:stable-pointers" name="Stable Pointers">).
+NOTE: currently all top-level objects are considered to be reachable,
+although we hope to remove this restriction in the future.  A
+<tt/Char/ or small <tt/Int/ will also be constantly reachable, since
+the garbage collector replaces heap-resident <tt/Char/s and small
+<tt/Int/s with pointers to static copies.
+
 Notice that a pointer to the key from its associated 
 value or finaliser does not make the key reachable.
 However, if the key is reachable some other way, then the value