News for hackers. Stuff that matters.
Re:Memory growth is being removed from asm.js by ndesaulniers on Sunday January 10, 2016 @12:45AM (#10874361)
It's weird to me to see this upvoted on HN.

1. I doubt most people here are using (or have used) asm.js, let alone memory growth.

2. Maybe people think some major feature is being removed from asm.js (not really, will expand below).

3. Maybe people are confusing asm.js with WebAssembly?

4. This will be in Web Assembly, see post's point #2.

Emscripten-emitted-code has a fixed size memory space (static memory, stack, heap). Heap size can grow, via sbrk, but if you moved the program break past the end of the Typed Array the code used as memory space, Emscripten could create a new Typed Array, copy over all data from the old to the new, free the old, and continue executing with data in the new. That process was memory growth, and was very slow. In practice, you never really needed it, since you could run your program a few times, see what the high water mark of your heap was, then set the precise size at compile time.

Memory growth was helpful if you wanted to start up faster, but could potentially have non-deterministic memory growth (though you'd still be limited to 32b address space).

Re:Memory growth is being removed from asm.js by vardump on Sunday January 10, 2016 @02:55AM (#10874613)
> In practice, you never really needed it, since you could run your program a few times, see what the high water mark of your heap was, then set the precise size at compile time.

How would this work with anything that has unknown runtime memory cost? Say an editor of any kind? Like an image editor with undo buffers.

Re:Memory growth is being removed from asm.js by CJefferson on Sunday January 10, 2016 @05:28AM (#10874884)
Exactly. For my uses (AI systems), variable memory was the thing which moved asm.js from a cute toy to a system I can genuinely use.
Re:Memory growth is being removed from asm.js by chadaustin on Sunday January 10, 2016 @01:49AM (#10874502)
At IMVU this feature was quite important. Why? Because we wanted more lightweight integration of 3D avatars with web pages. We didn't want our engine to allocate 300 MB or whatever of memory every time, because every single IMVU browser tab you'd have open would consume that much memory. It's so much nicer to allocate, say, 16 MB and grow it as needed by the use case. Chat rooms, for example, are much heavier than dress up.

I'm rather disappointed to see this turn of events.

For the use case of "load a heavy game" I largely agree with what you're saying.

Re:Memory growth is being removed from asm.js by morebetterer on Sunday January 10, 2016 @02:52AM (#10874608)
Isn't it possible to create multiple asm.js memory arenas?
Re:Memory growth is being removed from asm.js by morebetterer on Sunday January 10, 2016 @01:47AM (#10874497)
Aside from a few game demos, is anyone using asm.js in production systems?
Re:Memory growth is being removed from asm.js by chadaustin on Sunday January 10, 2016 @01:50AM (#10874505)
The 3D features on https://secure.imvu.com/next/ do. (You must be logged in to see them.)