diff --git a/ports/webassembly/wrapper.js b/ports/webassembly/wrapper.js index dcbfe6c017..24f4f8a72c 100644 --- a/ports/webassembly/wrapper.js +++ b/ports/webassembly/wrapper.js @@ -37,18 +37,18 @@ var mainProgram = function() if (typeof window === 'undefined' && require.main === module) { var fs = require('fs'); - var stack_size = 64 * 1024; + var heap_size = 128 * 1024; var contents = ''; var repl = true; for (var i = 0; i < process.argv.length; i++) { if (process.argv[i] === '-X' && i < process.argv.length - 1) { - if (process.argv[i + 1].includes('stack=')) { - stack_size = parseInt(process.argv[i + 1].split('stack=')[1]); + if (process.argv[i + 1].includes('heapsize=')) { + heap_size = parseInt(process.argv[i + 1].split('heapsize=')[1]); if (process.argv[i + 1].substr(-1).toLowerCase() === 'k') { - stack_size *= 1024; + heap_size *= 1024; } else if (process.argv[i + 1].substr(-1).toLowerCase() === 'm') { - stack_size *= 1024 * 1024; + heap_size *= 1024 * 1024; } } } else if (process.argv[i].includes('.py')) { @@ -56,7 +56,7 @@ var mainProgram = function() repl = false;; } } - mp_js_init(stack_size); + mp_js_init(heap_size); if (repl) { mp_js_init_repl();