4 ms·
> JS is a garbage-collected language. All you have to do to GC something is stop referencing it. That works well for JS... but if you are trying to use asm.js
by daurnimator 11y ago
> JS is a garbage-collected language. All you have to do to GC something is stop referencing it.
That works well for JS... but if you are trying to use asm.js (or now wasm), you need to act on things getting garbage collected inside of your code.
- krebby 11y agoYou're talking about implementing your own GC inside JS. A valid use case, but a niche one. JS the language doesn't really need to expose GC internals. JS the compile target does. (Though it can be worked around).
- daurnimator 11y ago> You're talking about implementing your own GC inside JS. A valid use case, but a niche one. Any asm.js code that calls into DOM apis is going to need this. Otherwise they don't know when to free stuff. Most of the current asm.js code out there just binds a single canvas element, and works with that. But if you want to actually call anything else....