Hacker News new | ask | show | jobs
by aanm1988 3386 days ago
> asm.js and WebAssembly give you the same control over memory layout as C

That's a bold statement right there.

1 comments

Not 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).