diff options
author | Alon Zakai <alonzakai@gmail.com> | 2015-11-22 21:54:03 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2015-11-22 21:54:03 -0800 |
commit | 7d0250a6e0f6a656637abce0a29cb4618eeedd68 (patch) | |
tree | 051b26722589a40de1fe310c5f9ac36d3d3a4390 /src | |
parent | 6e83fe2f9e9fdfb88fc9a62bb31c1f79768aa31a (diff) | |
download | binaryen-7d0250a6e0f6a656637abce0a29cb4618eeedd68.tar.gz binaryen-7d0250a6e0f6a656637abce0a29cb4618eeedd68.tar.bz2 binaryen-7d0250a6e0f6a656637abce0a29cb4618eeedd68.zip |
support memory growth in wasm.js native wasm integration code, which an work now that memory growth is shared in asm2wasm in both shell and js
Diffstat (limited to 'src')
-rw-r--r-- | src/js/post.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/js/post.js b/src/js/post.js index eda57a299..596831595 100644 --- a/src/js/post.js +++ b/src/js/post.js @@ -26,7 +26,9 @@ function integrateWasmJS(Module) { updateGlobalBuffer(newBuffer); updateGlobalBufferViews(); Module['reallocBuffer'] = function(size) { - abort('no memory growth quite yet, but easy to add'); + var old = Module['buffer']; + wasmJS['asmExports']['__growWasmMemory'](size); // tiny wasm method that just does grow_memory + return Module['buffer'] !== old ? Module['buffer'] : null; // if it was reallocated, it changed }; return instance; |