This is incorrect. GC marks every table as needing rehash; the next access to that table forces a rehash, which cleans the table.
On Mon, Dec 21, 2009 at 10:09 PM, Taylor R Campbell <[email protected]> wrote: > Key-weak hash tables are never cleaned automatically, not even in a > secondary GC daemon; unless you call HASH-TABLE/CLEAN! or cause them > to be rehashed, broken entries will retain their data (but not their > keys) strongly. > > (let ((a (make-eq-hash-table)) > (b (make-eq-hash-table))) > (let ((p (list 'p)) > (q (list 'q)) > (r (list 'r))) > (hash-table/put! a p q) > (hash-table/put! b q r)) > (gc-flip) > (list (hash-table/datum-list a) > (hash-table/datum-list b))) > ;Value: (() ((r))) > > The manual doesn't claim that *associations* are deleted from weak > hash tables if their keys are reclaimed -- it says only that the hash > table holds its keys weakly --, but this is not the behaviour I expect > for an object called a `weak hash table'. Does this behaviour worry > anyone else? > > > _______________________________________________ > MIT-Scheme-devel mailing list > [email protected] > http://lists.gnu.org/mailman/listinfo/mit-scheme-devel > _______________________________________________ MIT-Scheme-devel mailing list [email protected] http://lists.gnu.org/mailman/listinfo/mit-scheme-devel
