[][src]Function wamr_sys::wasm_runtime_instantiate

pub unsafe extern "C" fn wasm_runtime_instantiate(
    module: wasm_module_t,
    stack_size: u32,
    heap_size: u32,
    error_buf: *mut c_char,
    error_buf_size: u32
) -> wasm_module_inst_t

Instantiate a WASM module.

@param module the WASM module to instantiate @param 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 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. If heap_size is 0, the default heap size will be used. @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