iwasm: Disable app heap by default if wasi is enabled (#2346)

It's rare to require app heap with wasi and sometimes harmful in some cases:
https://github.com/bytecodealliance/wasm-micro-runtime/issues/2275
This commit is contained in:
YAMAMOTO Takashi 2023-07-07 17:09:15 +09:00 committed by GitHub
parent a300b627d5
commit 7448a994ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 2 deletions

View File

@ -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

View File

@ -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;