diff --git a/examples/embed/host.c b/examples/embed/host.c index 61c207c..e726fac 100644 --- a/examples/embed/host.c +++ b/examples/embed/host.c @@ -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; }