memory safety and weak references

Mark Miller erights at gmail.com
Tue Sep 8 19:55:48 UTC 2015


At
https://esdiscuss.org/topic/memory-safety-and-weak-references#content-1
Dave Herman wrote

> Interestingly, I wonder if the idea of only collecting weak references
> between turns is immune to such attacks, since it's not possible to
> have a bogus reference on the stack between turns, where there is
> no stack.

Sorry it has taken me more than two years to respond to this ;)

If you *actually* GC only between turns, then yes. However, I doubt this is
practical.

If you use the implementation technique shown at
http://wiki.ecmascript.org/doku.php?id=strawman:weak_references
so that you never observably collect during a turn, then no, it doesn't
help.

-- 
  Cheers,
  --MarkM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150908/0576c15a/attachment.html>


More information about the es-discuss mailing list