Sorry but I don't like the implementation.
You're using ObjectSpace.garbage_collect, ObjectSpace._id2ref and you
are extending from Hash an not properly defining the semantics you're
inheriting.

I'm not sure but I guess the only solution to avoid _id2ref is that
Ruby provides an implementation or making a C extension.

Thanks.

On Fri, Oct 15, 2010 at 9:26 PM, Asher <asher / ridiculouspower.com> wrote:
> The conservative nature of the GC makes this nigh impossible.
>
> See https://rubygems.org/gems/weakhash for details. It would be nice.
>
> Asher
>
> On Oct 15, 2010, at 7:21 PM, Santiago Pastorino wrote:
>
>> Hi guys,
>>
>> =A0I'm wondering why Ruby doesn't provide a WeakHash implementation. Do
>> you think could be a nice thing to add?.
>>
>> Best.
>>
>
>
>