wasmtime_func_call_unchecked function

  1. @Native<Pointer<wasmtime_error_t> Function(Pointer<wasmtime_context_t>, Pointer<wasmtime_func_t>, Pointer<wasmtime_val_raw_t>, Size, Pointer<Pointer<wasm_trap_t>>)>(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>>)>()
Pointer<wasmtime_error_t> wasmtime_func_call_unchecked(
  1. Pointer<wasmtime_context_t> store,
  2. Pointer<wasmtime_func_t> func,
  3. Pointer<wasmtime_val_raw_t> args_and_results,
  4. int args_and_results_len,
  5. Pointer<Pointer<wasm_trap_t>> trap,
)

\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_results pointer has enough space to hold all the parameters and all the results (but not at the same time).
  • The args_and_results_len contains the length of the args_and_results buffer.
  • Parameters must all be configured as if they were the correct type.
  • Values such as externref and funcref are 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,
);