Ephemerons
An ephemeron is similar to a weak box, except that
* an ephemeron contains a key and a value; the value can be extracted from the ephemeron, but the value is replaced by #f when
the automatic memory manager can prove that either the ephemeron or the key is reachable only through weak references; and
* nothing reachable from the value in an ephemeron counts toward the reachability of an ephemeron key (whether for the same
ephemeron or another), unless the same value is reachable through a non-weak reference, or unless the value's ephemeron key
is reachable through a non-weak reference.
In particular, an ephemeron can be combined with a weak hash table to produce a mapping where the memory manager can reclaim
key-value pairs even when the value refers to the key.
10-17
10-17
10-17