wasmtime_instance_pre_instantiate function

  1. @Native<Pointer<wasmtime_error_t> Function(Pointer<wasmtime_instance_pre_t> instance_pre, Pointer<wasmtime_context_t> store, Pointer<wasmtime_instance_t> instance, Pointer<Pointer<wasm_trap_t>> trap_ptr)>(ffi.Pointer<wasmtime_instance_pre_t>, ffi.Pointer<wasmtime_context_t>, ffi.Pointer<wasmtime_instance_t>, ffi.Pointer<ffi.Pointer<wasm_trap_t>>)>()
Pointer<wasmtime_error_t> wasmtime_instance_pre_instantiate(
  1. Pointer<wasmtime_instance_pre_t> instance_pre,
  2. Pointer<wasmtime_context_t> store,
  3. Pointer<wasmtime_instance_t> instance,
  4. Pointer<Pointer<wasm_trap_t>> trap_ptr,
)

\brief Instantiates instance within the given store.

This will also run the function's startup function, if there is one.

For more information on instantiation see #wasmtime_instance_new.

\param instance_pre the pre-initialized instance \param store the store in which to create the instance \param instance where to store the returned instance \param trap_ptr where to store the returned trap

\return One of three things can happen as a result of this function. First the module could be successfully instantiated and returned through instance, meaning the return value and trap are both set to NULL. Second the start function may trap, meaning the return value and instance are set to NULL and trap describes the trap that happens. Finally instantiation may fail for another reason, in which case an error is returned and trap and instance are set to NULL.

This function does not take ownership of any of its arguments, and all return values are owned by the caller.

Implementation

@ffi.Native<
  ffi.Pointer<wasmtime_error_t> Function(
    ffi.Pointer<wasmtime_instance_pre_t>,
    ffi.Pointer<wasmtime_context_t>,
    ffi.Pointer<wasmtime_instance_t>,
    ffi.Pointer<ffi.Pointer<wasm_trap_t>>,
  )
>()
external ffi.Pointer<wasmtime_error_t> wasmtime_instance_pre_instantiate(
  ffi.Pointer<wasmtime_instance_pre_t> instance_pre,
  ffi.Pointer<wasmtime_context_t> store,
  ffi.Pointer<wasmtime_instance_t> instance,
  ffi.Pointer<ffi.Pointer<wasm_trap_t>> trap_ptr,
);