Re: Fwd: [srfi-126] Draft #2. (#1)
John Cowan 10 Sep 2015 13:25 UTC
Taylan Ulrich Bayırlı/Kammer scripsit:
> 1. a bucket-vector of the same size as the source hashtable's
> bucket vector is allocated, 2. this allocation triggers the GC, 3. the
> source hashtable's bucket vector gets shrinked and rehashed because some
> entries were removed due to being weak,
I don't think removing hash entries, much less rehashing, should be
done on the collector thread anyway. For general (non-eq, non-eqv)
hash tables, the GC doesn't need to know what they are, and since
buckets hold their weak pairs or ephemerons strongly, it shouldn't
remove any. Cleanup can be done incrementally as the hash table is
further accessed, or a mechanism like Java's reference queues can be used:
<https://dzone.com/articles/letting-garbage-collector-do-c>
--
John Cowan http://www.ccil.org/~cowan xxxxxx@ccil.org
Said Agatha Christie / To E. Philips Oppenheim
"Who is this Hemingway? / Who is this Proust?
Who is this Vladimir / Whatchamacallum,
This neopostrealist / Rabble?" she groused.
--George Starbuck, Pith and Vinegar