What I am suggesting would not be bound to a WeakRef rather to the WeakMap.
So in my mind it seems like the WeakMap can maintain a strong ref to the
values it stores (not the keys obviously) and before the value get's
removed from that WeakMap, fire off a notifier.


On Mon, Nov 11, 2013 at 11:46 AM, Boris Zbarsky <[email protected]> wrote:

> On 11/11/13 2:43 PM, Matthew Robb wrote:
>
>> I haven't been able to read through all of this very thoroughly but I
>> would like to inject that I have a use case right now for some sort of
>> callback on a WeakMap that notifies AFTER the key has been GC'd but
>> before the value has been released.
>>
>
> Requiring the existence of such a point in time (at all, even if there is
> no callback at that poing) is a significant constraint on GC implementation
> strategies, as far as I can tell.  For example, it prevents finalization of
> a bunch of objects as a unit via free() or munmap() or equivalent of an
> arena...
>
> -Boris
>
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss
>



-- 
- Matthew Robb
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to