11 ms·
asm.js is a way to write javascript to help the JIT. It's intended to be autogenerated by tools. It has nothing to do with GC. asm.js will accumulate garbage ju
by general_failure 13y ago
asm.js is a way to write javascript to help the JIT. It's intended to be autogenerated by tools. It has nothing to do with GC. asm.js will accumulate garbage just like normal javascript.
- peterhunt 13y agoI don't think that's correct, since I believe asm.js manages its own heap via a big typed array and does not allocate anything tracked by the runtime GC (at least that's what LLJS does and I believe that asm.js does the same thing)
- v413 13y agoNo. asm.js is simply a subset of javascript. That is all. Here is the actual spec: http://asmjs.org/spec/latest/ http://asmjs.org/spec/latest/ The creation of big typed array simulating a memory pool is a construction of Emscripten. asm.js in that context is simply the vehicle / language.
- peterhunt 13y agoHmm perhaps it's not part of the spec, but I believe all languages that compile down to it do this. And the spec mentions "absence of garbage collection" so I believe you're at the very least strongly encouraged to avoid it (if not forbidden -- does OdinMonkey even have a GC?)
- deleted 13y ago[deleted]
- spyder 13y agoThere is no garbage in asm.js: "The asm.js model provides a model closer to C/C++ by eliminating dynamic type guards, boxed values, and garbage collection." From the asm.js FAQ (http://asmjs.org/faq.html http://asmjs.org/faq.html)