From 7a505d57dc07cc6aa869c3f99082dcc93871377b Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 3 Nov 2022 17:36:14 +1100 Subject: [PATCH] webassembly: Change "stack" argument to "heapsize". Because that's what mp_js_init() takes as its argument. Signed-off-by: Damien George --- ports/webassembly/wrapper.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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();