wasmtime_func_call_unchecked function
- @Native<Pointer<
wasmtime_error_t> Function(Pointer<wasmtime_context_t> , Pointer<wasmtime_func_t> , Pointer<wasmtime_val_raw_t> , Size, Pointer<Pointer< )>(ffi.Pointer<wasmtime_context_t>, ffi.Pointer<wasmtime_func_t>, ffi.Pointer<wasmtime_val_raw_t>, ffi.Size, ffi.Pointer<ffi.Pointer<wasm_trap_t>>)>()wasm_trap_t> >
- Pointer<
wasmtime_context_t> store, - Pointer<
wasmtime_func_t> func, - Pointer<
wasmtime_val_raw_t> args_and_results, - int args_and_results_len,
- Pointer<
Pointer< trap,wasm_trap_t> >
\brief Call a WebAssembly function in an "unchecked" fashion.
This function is similar to #wasmtime_func_call except that there is no type
information provided with the arguments (or sizing information). Consequently
this is less safe to call since it's up to the caller to ensure that args
has an appropriate size and all the parameters are configured with their
appropriate values/types. Additionally all the results must be interpreted
correctly if this function returns successfully.
Parameters must be specified starting at index 0 in the args_and_results
array. Results are written starting at index 0, which will overwrite
the arguments.
Callers must ensure that various correctness variants are upheld when this API is called such as:
- The
args_and_resultspointer has enough space to hold all the parameters and all the results (but not at the same time). - The
args_and_results_lencontains the length of theargs_and_resultsbuffer. - Parameters must all be configured as if they were the correct type.
- Values such as
externrefandfuncrefare valid within the store being called.
When in doubt it's much safer to call #wasmtime_func_call. This function is faster than that function, but the tradeoff is that embeddings must uphold more invariants rather than relying on Wasmtime to check them for you.
Implementation
@ffi.Native<
ffi.Pointer<wasmtime_error_t> Function(
ffi.Pointer<wasmtime_context_t>,
ffi.Pointer<wasmtime_func_t>,
ffi.Pointer<wasmtime_val_raw_t>,
ffi.Size,
ffi.Pointer<ffi.Pointer<wasm_trap_t>>,
)
>()
external ffi.Pointer<wasmtime_error_t> wasmtime_func_call_unchecked(
ffi.Pointer<wasmtime_context_t> store,
ffi.Pointer<wasmtime_func_t> func,
ffi.Pointer<wasmtime_val_raw_t> args_and_results,
int args_and_results_len,
ffi.Pointer<ffi.Pointer<wasm_trap_t>> trap,
);