use pool memory allocator for wasm runtime

This commit is contained in:
2026-02-05 23:45:13 +01:00
parent 2f8f737bb8
commit 650f457c5b

View File

@ -20,10 +20,14 @@ MAIN() {
wasm_exec_env_t exec_env;
/* initialize the wasm runtime */
static char global_heap_buf[HEAP_SIZE];
RuntimeInitArgs init_args;
memset(&init_args, 0, sizeof(init_args));
memset(&init_args, 0, sizeof(RuntimeInitArgs));
init_args.mem_alloc_type = Alloc_With_System_Allocator;
init_args.mem_alloc_type = Alloc_With_Pool;
init_args.mem_alloc_option.pool.heap_buf = global_heap_buf;
init_args.mem_alloc_option.pool.heap_size = sizeof(global_heap_buf);
init_args.max_thread_num = 1;
if (!wasm_runtime_full_init(&init_args)) {
return;
}