Skip to content

Commit

Permalink
iwasm: disable app heap by default if wasi is enabled
Browse files Browse the repository at this point in the history
* it's rare to require app heap with wasi

* it's even harmful in some cases
  cf. #2275

* i'm a bit tired to type "--heap-size=0"
  • Loading branch information
yamt committed Jul 6, 2023
1 parent e495276 commit aa90fdb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
7 changes: 6 additions & 1 deletion product-mini/platforms/posix/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,12 @@ main(int argc, char *argv[])
const char *func_name = NULL;
uint8 *wasm_file_buf = NULL;
uint32 wasm_file_size;
uint32 stack_size = 64 * 1024, heap_size = 16 * 1024;
uint32 stack_size = 64 * 1024;
#if WASM_ENABLE_LIBC_WASI != 0
uint32 heap_size = 0;
#else
uint32 heap_size = 16 * 1024;
#endif
#if WASM_ENABLE_FAST_JIT != 0
uint32 jit_code_cache_size = FAST_JIT_DEFAULT_CODE_CACHE_SIZE;
#endif
Expand Down
7 changes: 6 additions & 1 deletion product-mini/platforms/windows/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,12 @@ main(int argc, char *argv[])
const char *func_name = NULL;
uint8 *wasm_file_buf = NULL;
uint32 wasm_file_size;
uint32 stack_size = 64 * 1024, heap_size = 16 * 1024;
uint32 stack_size = 64 * 1024;
#if WASM_ENABLE_LIBC_WASI != 0
uint32 heap_size = 0;
#else
uint32 heap_size = 16 * 1024;
#endif
#if WASM_ENABLE_JIT != 0
uint32 llvm_jit_size_level = 3;
uint32 llvm_jit_opt_level = 3;
Expand Down

0 comments on commit aa90fdb

Please sign in to comment.