Hi,
Below is an improved version of the patch I originally sent. The goal
of the original patch (and associated test case) was to ensure that an
object associated to a weak key (resp. a weak value) is GC'd _after_
that key (resp. value).
However, as Han-Wen pointed out earlier in this thread, with the
original patch, cyclical structures within a weak-key (or weak-value)
alist vectors would never become unmarked. By "cyclical structure", I
mean something like:
key A is associated to B
key B is associated to C
Here (assuming a weakly-keyed alist vector), object B is used both as a
key and a value, resulting in a "cyclical structure".