Draft wamr modifications + host program structure sections
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
static RuntimeInitArgs init_args;
|
||||
memset(&init_args, 0, sizeof(RuntimeInitArgs));
|
||||
|
||||
// If using Alloc_With_Allocator:
|
||||
init_args.mem_alloc_type = Alloc_With_Allocator;
|
||||
init_args.mem_alloc_option.allocator.malloc_func = (void *)wamr_malloc;
|
||||
init_args.mem_alloc_option.allocator.realloc_func = (void *)wamr_realloc;
|
||||
init_args.mem_alloc_option.allocator.free_func = (void *)wamr_free;
|
||||
|
||||
// If using Alloc_With_Pool instead:
|
||||
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)) {
|
||||
goto error_cleanup;
|
||||
}
|
||||
Reference in New Issue
Block a user