Get the exported APIs of base lib
Get the package type of a buffer.
Find the specified function in argv[0] from a WASM module instance
and execute that function.
Find the unique main function from a WASM module instance
and execute that function.
Convert app address(relative address) to native address(absolute address)
Convert native address(absolute address) to app address(relative address)
Call the given WASM function of a WASM module instance with
arguments (bytecode and AoT).
Call the given WASM function of a WASM module instance with
provided results space and arguments (bytecode and AoT).
Call the given WASM function of a WASM module instance with
provided results space and variant arguments (bytecode and AoT).
Clear exception info of the WASM module instance.
Create execution environment for a WASM module instance.
Deinstantiate a WASM module instance, destroy the resources.
Destroy the WASM runtime environment.
Destroy the execution environment.
Dump runtime memory consumption, including:
Exec env memory consumption
WASM module memory consumption
WASM module instance memory consumption
stack and app heap used info
Initialize the WASM runtime environment, and also initialize
the memory allocator and register native symbols, which are specified
with init arguments
Get the app address range (relative address) that a app address belongs to
Get the custom data within a WASM module instance.
Get exception info of the WASM module instance.
Get attachment of native function from execution environment
Get WASM module instance from execution environment
Get the native address range (absolute address) that a native address belongs to
Get the user data within execution environment.
Initialize the WASM runtime environment, and also initialize
the memory allocator with system allocator, which calls os_malloc
to allocate memory
Instantiate a WASM module.
Load a WASM module from a specified byte buffer. The byte buffer can be
WASM binary data when interpreter or JIT is enabled, or AOT binary data
when AOT is enabled. If it is AOT binary data, it must be 4-byte aligned.
Load a WASM module from a specified WASM or AOT section list.
Lookup an exported function in the WASM module instance.
Allocate memory from runtime memory environment.
Allocate memory from the heap of WASM module instance and initialize
the memory with src
Free memory to the heap of WASM module instance
Allocate memory from the heap of WASM module instance
Reallocate memory from runtime memory environment
Register native functions with same module name
Register native functions with same module name, similar to
wasm_runtime_register_natives, the difference is that runtime passes raw
arguments to native API, which means that the native API should be defined as:
void foo(wasm_exec_env_t exec_env, uint64 *args);
and native API should extract arguments one by one from args array with macro
native_raw_get_arg
and write the return value back to args[0] with macro
native_raw_return_type and native_raw_set_return
Set custom data to WASM module instance.
Set exception info of the WASM module instance.
Set user data to execution environment.
Unload a WASM module.
Validate the app address, check whether it belongs to WASM module
instance’s address space, or in its heap space or memory space.
Similar to wasm_runtime_validate_app_addr(), except that the size parameter
is not provided. This function validates the app string address, check whether it
belongs to WASM module instance’s address space, or in its heap space or
memory space. Moreover, it checks whether it is the offset of a string that
is end with ‘\0’.
@param module_inst the WASM module instance
@param app_str_offset the app address of the string to validate, which is a
relative address
Validate the native address, check whether it belongs to WASM module
instance’s address space, or in its heap space or memory space.