guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Marking weak alist vectors, #2


From: Han-Wen Nienhuys
Subject: Re: [PATCH] Marking weak alist vectors, #2
Date: Thu, 24 Nov 2005 01:59:55 +0100
User-agent: Mozilla Thunderbird 1.0.7-1.1.fc4 (X11/20050929)

Ludovic Courtès wrote:
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".

No, this is not cyclic. The problem is a situation where key A is associated to key A, eg.

  (define x (cons 1 2))
  (set-cdr! x s)
  (weak-key-hash-table-set! table s x)

x points back to s, and s is a key in the table.

(I haven't looked at how your patch deals with this, just clarifying your text)

--
 Han-Wen Nienhuys - address@hidden - http://www.xs4all.nl/~hanwen





reply via email to

[Prev in Thread] Current Thread [Next in Thread]