[gclist] weak pointer and gc

Charles Fiterman cef@geodesic.com
Sat, 14 Apr 2001 11:37:45 -0500

>    It seems that such a weak-pointer symbol table
>is expensive to maintain.  At the garbage
>collection time, the collector probably has zero
>out the weak pointer references.  Later when
>the table is accessed, via an accessor method,
>the table entries and overflow
>chains probably need to be cleaned up.

Weak pointers are fairly cheap. The collector needs a table entry for every
weak pointer connecting it to the object. The weak pointer itself needs to
be hidden in some fashion, that means the collector can't use it. In
precise collection that just means it isn't a pointer on the object's
description. In conservative collectors that means its in a leaf object or
its hashed.