Next: Finalization, Previous: Generational GC, Up: Garbage Collection [Contents][Index]
A weak pointer provides a way to maintain a reference to an object without preventing an object from being garbage collected. If the garbage collector discovers that the only pointers to an object are weak pointers, then it breaks the weak pointers and deallocates the object.
make-weak-pointer
returns a weak pointer to an object.
weak-pointer-value
follows a weak pointer, returning the two
values: the object pointed to (or nil
if broken) and a boolean
value which is nil
if the pointer has been broken, and true
otherwise.