3 ms·
Could anyone explain ephemerons further, maybe with examples? It seems really interesting.
by doomrobo 11y ago
Could anyone explain ephemerons further, maybe with examples? It seems really interesting.
- jlouis 11y agoThe wikipedia page explains them pretty well I think, so going there is a better explanation than anything else. For a programmer, they allow you to be more precise about the point in time where an object should be regarded as a weak object. That is, an object which can be collected when under GC pressure. A weak references edges itself toward this goal, but often require some manual intervention and/or knowledge of the GC world to manage by the programmer. An ephemeron removes this additional knowledge from the programmers mind. It allows one programmer to make an interface which is truly not leaking in GC abstraction. So other programmers don't have to know about it at all.