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: Ludovic Courtès
Subject: Re: [PATCH] Marking weak alist vectors, #2
Date: Thu, 24 Nov 2005 10:01:10 +0100
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux)

Hi,

Han-Wen Nienhuys <address@hidden> writes:

> 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.

Ah, alright.  Well yes, the new patch does handle it, the previous one
didn't.  The issue at hand was similar to the one which showed up in my
"cascading weak keys" example.

  $ ../pre-inst-guile --no-debug
  guile> (use-modules (ice-9 weak-vector))
  guile> (define t (make-weak-key-alist-vector 12))
  guile> (define s (string-copy "chbouib"))
  guile> (hashq-set! t s (cons s 1))
  ("chbouib" . 1)
  guile> (set! s #f)
  guile> (gc)  
  guile> t
  #wh(() () () () () () () () () () () ())

Thanks,
Ludovic.




reply via email to

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