On 27 November 2012 11:11, Denis Kudriashov <dionisiydk@gmail.com> wrote:
You could take a look at the WeakDictionary that ships in a standard Squeak image, if there isn't already one lying around in Pharo. There are several classes using weak references.
I will look at squeak stuff. But my question more about about conceptual problem: I need week dictionary which values has reference to it key. Can it be really week? I think it can be kind of "ephemeron problem" and such dictionary contents will never be garbaged. Is ephemerons supported by latest vm?
Ephemerons support is in VM. All you need is to load image-side code. http://code.google.com/p/cog/issues/detail?id=44 I plan to change implementation to use separate object format id. But if you need it right now, you can use them in current state.
In pharo I see two classes: WeakKeyDictionary and WeakValueDictionary. What you think I should use to implement my requirements: cache which can be cleaned by garbage collector due to weak keys or values?
2012/11/27 Stéphane Ducasse <stephane.ducasse@inria.fr>
Ghost
I think it is just implementation of very skin proxy objects? Is it related to weak dictionary cache?
-- Best regards, Igor Stasenko.