Skip to content

Commit d609acf

Browse files
committed
Move the default heap size initialization
1 parent de82d19 commit d609acf

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

core/iwasm/common/wasm_c_api.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,6 @@ wasm_engine_new_internal(wasm_config_t *config)
392392

393393
WASM_C_DUMP_PROC_MEM();
394394

395-
init_args.gc_heap_size = GC_HEAP_SIZE_DEFAULT;
396395
/* wasm_config_t->MemAllocOption -> RuntimeInitArgs->MemAllocOption */
397396
init_args.mem_alloc_type = config->mem_alloc_type;
398397
memcpy(&init_args.mem_alloc_option, &config->mem_alloc_option,

core/iwasm/common/wasm_runtime_common.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,10 @@ wasm_runtime_full_init_internal(RuntimeInitArgs *init_args)
757757
#endif
758758

759759
#if WASM_ENABLE_GC != 0
760-
gc_heap_size_default = init_args->gc_heap_size;
760+
uint32 gc_heap_size = init_args->gc_heap_size;
761+
if (gc_heap_size > 0) {
762+
gc_heap_size_default = gc_heap_size;
763+
}
761764
#endif
762765

763766
#if WASM_ENABLE_JIT != 0

0 commit comments

Comments
 (0)