3 ms·
Can someone explain the differences between this and weak references in a VM with garbage collection?
by madair 17y ago
Can someone explain the differences between this and weak references in a VM with garbage collection?
- arohner 17y agoTo be pedantic, scheme is garbage collected, and several use a VM. PLT already has weak references, and the author assumes the Scheme implementation already has them. As far as I can tell, this is somewhat like a weakHashMap, except each ephemeron only handles one key value pair.
- copper 17y agoPLT already has ephemerons too: http://docs.plt-scheme.org/reference/ephemerons.html http://docs.plt-scheme.org/reference/ephemerons.html
- madair 17y agoThanks! That link says it pretty clear: In particular, an ephemeron can be combined with a weak hash table (see Hash Tables) to produce a mapping where the memory manager can reclaim key–value pairs even when the value refers to the key.