On Tue, Dec 17, 2013 at 4:16 PM, Andrew McCreight <amccrei...@mozilla.com>wrote:

> Of course, these kinds of cache references would need to be different than
> other weak references, at both the language level (if you want regular weak
> references, then these cachey references are a kind of short-term leak) and
> implementation level (you may want to allocate this kind of data in ashmem,
> somehow).
>
> Another way to implement this kind of cache without weak references is to
> have a low-memory event that gets triggered when the system is low on
> memory.  A page that wants to have a cache could listen for that event, and
> purge its caches.  Then the runtime wouldn't need to explicitly reason
> about the caches.  In fact, we already have such an event, though it isn't
> exposed to content.
>

Agreed, that would fully cover the caching use case, and is something I
think we should propose as a platform feature.
_______________________________________________
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

Reply via email to