From 9604fa361b96ca81628475e6aea5230e7e455748 Mon Sep 17 00:00:00 2001 From: Amirouche Date: Mon, 28 Oct 2019 12:21:37 +0100 Subject: [PATCH] Makefile: js/chibi.js: ALLOW_MEMORY_GROWTH=1 `ALLOW_MEMORY_GROWTH=1` allows to grow the wasm vm memory space as needed and avoid out-of-memory issues. This is for development purpose, production build will want to set memory size to something that is fit the application (I don't remember the actual option name, but removing ALLOW_MEMORY_GROWTH=1 from the compilation, and re-running the app will display the good option to use). --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d3608258..8d1593db 100644 --- a/Makefile +++ b/Makefile @@ -122,7 +122,7 @@ all: chibi-scheme$(EXE) all-libs chibi-scheme.pc $(META_FILES) js: js/chibi.js js/chibi.js: chibi-scheme-emscripten chibi-scheme-static.bc js/pre.js js/post.js js/exported_functions.json - emcc -O0 chibi-scheme-static.bc -o $@ -s MODULARIZE=1 -s EXPORT_NAME=\"Chibi\" -s EXPORTED_FUNCTIONS=@js/exported_functions.json `find lib -type f \( -name "*.scm" -or -name "*.sld" \) -printf " --preload-file %p"` -s 'EXTRA_EXPORTED_RUNTIME_METHODS=["ccall", "cwrap"]' --pre-js js/pre.js --post-js js/post.js + emcc -O0 chibi-scheme-static.bc -o $@ -s ALLOW_MEMORY_GROWTH=1 -s MODULARIZE=1 -s EXPORT_NAME=\"Chibi\" -s EXPORTED_FUNCTIONS=@js/exported_functions.json `find lib -type f \( -name "*.scm" -or -name "*.sld" \) -printf " --preload-file %p"` -s 'EXTRA_EXPORTED_RUNTIME_METHODS=["ccall", "cwrap"]' --pre-js js/pre.js --post-js js/post.js chibi-scheme-static.bc: emmake $(MAKE) PLATFORM=emscripten CHIBI_DEPENDENCIES= CHIBI=./chibi-scheme-emscripten PREFIX= CFLAGS=-O2 SEXP_USE_DL=0 EXE=.bc SO=.bc CPPFLAGS="-DSEXP_USE_STRICT_TOPLEVEL_BINDINGS=1 -DSEXP_USE_ALIGNED_BYTECODE=1 -DSEXP_USE_STATIC_LIBS=1 -DSEXP_USE_STATIC_LIBS_NO_INCLUDE=0" clibs.c chibi-scheme-static.bc