Draft wamr modifications + host program structure sections

This commit is contained in:
2026-09-11 17:03:16 +02:00
parent 0d4c0fb3c9
commit 63531014d6
24 changed files with 526 additions and 190 deletions
@@ -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;
}