Browse Source

webassembly: Change "stack" argument to "heapsize".

Because that's what mp_js_init() takes as its argument.

Signed-off-by: Damien George <damien@micropython.org>
pull/9752/head
Damien George 2 years ago
parent
commit
7a505d57dc
  1. 12
      ports/webassembly/wrapper.js

12
ports/webassembly/wrapper.js

@ -37,18 +37,18 @@ var mainProgram = function()
if (typeof window === 'undefined' && require.main === module) { if (typeof window === 'undefined' && require.main === module) {
var fs = require('fs'); var fs = require('fs');
var stack_size = 64 * 1024; var heap_size = 128 * 1024;
var contents = ''; var contents = '';
var repl = true; var repl = true;
for (var i = 0; i < process.argv.length; i++) { for (var i = 0; i < process.argv.length; i++) {
if (process.argv[i] === '-X' && i < process.argv.length - 1) { if (process.argv[i] === '-X' && i < process.argv.length - 1) {
if (process.argv[i + 1].includes('stack=')) { if (process.argv[i + 1].includes('heapsize=')) {
stack_size = parseInt(process.argv[i + 1].split('stack=')[1]); heap_size = parseInt(process.argv[i + 1].split('heapsize=')[1]);
if (process.argv[i + 1].substr(-1).toLowerCase() === 'k') { 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') { } 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')) { } else if (process.argv[i].includes('.py')) {
@ -56,7 +56,7 @@ var mainProgram = function()
repl = false;; repl = false;;
} }
} }
mp_js_init(stack_size); mp_js_init(heap_size);
if (repl) { if (repl) {
mp_js_init_repl(); mp_js_init_repl();

Loading…
Cancel
Save