pub unsafe extern "C" fn wasm_runtime_instantiate(
module: wasm_module_t,
default_stack_size: u32,
host_managed_heap_size: u32,
error_buf: *mut c_char,
error_buf_size: u32,
) -> wasm_module_inst_t
Expand description
Instantiate a WASM module.
@param module the WASM module to instantiate @param default_stack_size the default stack size of the module instance when the exec env’s operation stack isn’t created by user, e.g. API wasm_application_execute_main() and wasm_application_execute_func() create the operation stack internally with the stack size specified here. And API wasm_runtime_create_exec_env() creates the operation stack with stack size specified by its parameter, the stack size specified here is ignored. @param host_managed_heap_size the default heap size of the module instance, a heap will be created besides the app memory space. Both wasm app and native function can allocate memory from the heap. @param error_buf buffer to output the error info if failed @param error_buf_size the size of the error buffer
@return return the instantiated WASM module instance, NULL if failed