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. -j _______________________________________________ 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