您的位置:首页 > 其它

July 16th Thursday (七月 十六日 木曜日)

2009-07-16 16:17 393 查看
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.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: