On Tue, Dec 17, 2013 at 4:43 PM, Jason Orendorff <jorendo...@mozilla.com>wrote:
> On 12/17/13 8:37 AM, Till Schneidereit wrote: > > Here's another use case for weak references that I don't think has been > > mentioned yet: > > > > Caching of expensive-to-recreate data. > > If you actually did this, you would soon want some control over the > cache: the ability to retain recently used entries across GC, for > example; the ability to treat some caches as more important than others; > etc. > > To add to Andrew's point, while the data binding use case supposedly > needs weak references to be freed as soon as possible, this use case > requires the opposite: weak references that stick around as long as > possible. > > This is another anti-use-case for weak references: an intuitively > appealing use that turns out to be worthless in practice. > I actually did use this, and disagree. While I think that what Andrew proposed is better, having weak references is still better than having nothing at all. However, low-memory events are probably not only better, but also far less controversial, so yes: as a real argument for weak references, this is moot. _______________________________________________ dev-tech-js-engine-internals mailing list dev-tech-js-engine-internals@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-tech-js-engine-internals