27 ms·
> asm.js and WebAssembly give you the same control over memory layout as C That's a bold statement right there.
by aanm1988 10y ago
> asm.js and WebAssembly give you the same control over memory layout as C
That's a bold statement right there.
- flohofwoe 10y agoNot at all, both asm.js and wasm give you a flat memory region (in asm.js it's a single, big JS typed array), the stack and all allocations live in this 'heap', managed by emscripten's malloc wrapper (which is jemalloc I think), the resulting memory layout is the same as on a native 32-bit platform, with the same alignment rules. There are no 'managed' Javascript objects in asm.js or wasm (unless you need to call out into web APIs).