Concerns about weak refs and weak maps.

Jim Deville jdeville at microsoft.com
Fri Oct 29 15:18:07 PDT 2010


C# 4.0 has WeakMap's too, and one of the goals was to work around the cyclical reference issue:

http://blogs.msdn.com/b/clrteam/archive/2009/05/18/the-conditional-weak-table-enabling-dynamic-object-properties.aspx



-----Original Message-----
From: es-discuss-bounces at mozilla.org [mailto:es-discuss-bounces at mozilla.org] On Behalf Of Allen Wirfs-Brock
Sent: Friday, October 29, 2010 3:04 PM
To: Allen Wirfs-Brock; felix; Brendan Eich
Cc: Andreas Gal; es-discuss
Subject: RE: Concerns about weak refs and weak maps.

Oops, typo fixed  below

> -----Original Message-----
> From: es-discuss-bounces at mozilla.org [mailto:es-discuss- 
> bounces at mozilla.org] On Behalf Of Allen Wirfs-Brock
> Sent: Friday, October 29, 2010 12:24 PM
> To: felix; Brendan Eich
> Cc: Andreas Gal; es-discuss
> Subject: RE: Concerns about weak refs and weak maps.
> 
> > -----Original Message-----
> > From: es-discuss-bounces at mozilla.org [mailto:es-discuss- 
> > bounces at mozilla.org] On Behalf Of felix
> > Sent: Friday, October 29, 2010 12:18 PM
> > To: Brendan Eich
> ...
> > >
> > > Yet don't Java and .NET have weak-keyed maps of some sort?
> >
> > Java has WeakHashMap, which is a map of weak references to values, 
> > which can leak uncollectible garbage if you have a cycle of 
> > WeakHashMap entries holding references to objects that are not 
> > otherwise
> referenced.
 
Which is the problem addressed by the proposed ephemeron-like Weak Map solution for ECMAScript

_______________________________________________
es-discuss mailing list
es-discuss at mozilla.org
https://mail.mozilla.org/listinfo/es-discuss



More information about the es-discuss mailing list