wamr_sys

Function wasm_runtime_call_wasm

Source
pub unsafe extern "C" fn wasm_runtime_call_wasm(
    exec_env: wasm_exec_env_t,
    function: wasm_function_inst_t,
    argc: u32,
    argv: *mut u32,
) -> bool
Expand description

Call the given WASM function of a WASM module instance with arguments (bytecode and AoT).

@param exec_env the execution environment to call the function, which must be created from wasm_create_exec_env() @param function the function to call @param argc total cell number that the function parameters occupy, a cell is a slot of the uint32 array argv[], e.g. i32/f32 argument occupies one cell, i64/f64 argument occupies two cells, note that it might be different from the parameter number of the function @param argv the arguments. If the function has return value, the first (or first two in case 64-bit return value) element of argv stores the return value of the called WASM function after this function returns.

@return true if success, false otherwise and exception will be thrown, the caller can call wasm_runtime_get_exception to get the exception info.