guile-user
[Top][All Lists]
Advanced

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

Weak hash tables are too strong?


From: Neil Jerram
Subject: Weak hash tables are too strong?
Date: 16 Jan 2002 07:20:49 +0000
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

In the following example, can anyone explain to me what is preventing
the vector #(2 3 4) from being GC'd?  Or am I misunderstanding how
weak hash tables are meant to work?

guile> (define b (make-doubly-weak-hash-table 7))
guile> b
#w(() () () () () () ())
guile> (begin (hash-set! b 2 (vector 2 3 4)) 3)
3
guile> b
#w(() () ((2 . #(2 3 4))) () () () ())
guile> (gc)
guile> b
#w(() () ((2 . #(2 3 4))) () () () ())
guile> (gc)
guile> b
#w(() () ((2 . #(2 3 4))) () () () ())
guile> 

Thanks,
        Neil




reply via email to

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