[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
GC and tables
One of the problems which has often surfaced while hacking T, and most
recently with the single-stepper, is that of creating a virtual link
between two objects. Logically, what I want is a function (or table)
mapping objects to objects with the added feature that the table does
not prevent keys from being garbage-collected nor does it keep f(x)\n from being GCed *AFTER* x has been GCed.
One implementation would be to simply extend the length of the object
by one pointer field. This is clearly unfeasible.
Using "weak pointers" - the functions OBJECT-HASH and OBJECT-UNHASH
satisfies the first condition, but not the second.
Populations don't seem to be a reasonable mechanism either.
Does anyone have such a table implementation? Can it be written by
GC hooks?
--- Jonathan