220 void (*finalizer)(
void *),
286#define WASMTIME_I32 0
288#define WASMTIME_I64 1
290#define WASMTIME_F32 2
292#define WASMTIME_F64 3
294#define WASMTIME_V128 4
297#define WASMTIME_FUNCREF 5
300#define WASMTIME_EXTERNREF 6
303#define WASMTIME_ANYREF 7
355static inline bool wasmtime_funcref_is_null(
const wasmtime_func_t *func) {
420static inline void __wasmtime_val_assertions() {
423 "should be 8-byte aligned");
Definition of wasmtime_extern_t and external items.
A WebAssembly value in the any hierarchy of GC types.
Definition: val.h:39
uint32_t __private1
Internal to Wasmtime.
Definition: val.h:44
uint32_t __private2
Internal to Wasmtime.
Definition: val.h:46
uint64_t store_id
Definition: val.h:42
An interior pointer into a wasmtime_store_t which is used as "context" for many functions.
A host-defined un-forgeable reference to pass into WebAssembly.
Definition: val.h:174
uint64_t store_id
Definition: val.h:177
uint32_t __private2
Internal to Wasmtime.
Definition: val.h:181
uint32_t __private1
Internal to Wasmtime.
Definition: val.h:179
Representation of a function in Wasmtime.
Definition: extern.h:25
uint64_t store_id
Definition: extern.h:31
Container for different kinds of wasm values.
Definition: val.h:441
wasmtime_valkind_t kind
Discriminant of which field of of is valid.
Definition: val.h:443
wasmtime_valunion_t of
Container for the extern item's value.
Definition: val.h:445
Container for possible wasm values.
Definition: val.h:372
uint32_t anyref
Definition: val.h:400
uint32_t externref
Definition: val.h:408
float32_t f32
Definition: val.h:384
float64_t f64
Definition: val.h:388
int32_t i32
Definition: val.h:376
wasmtime_v128 v128
Definition: val.h:392
int64_t i64
Definition: val.h:380
void * funcref
Definition: val.h:415
Container for different kinds of wasm values.
Definition: val.h:319
wasmtime_func_t funcref
Definition: val.h:336
int32_t i32
Field used if wasmtime_val_t::kind is WASMTIME_I32.
Definition: val.h:321
wasmtime_v128 v128
Field used if wasmtime_val_t::kind is WASMTIME_V128.
Definition: val.h:338
float32_t f32
Field used if wasmtime_val_t::kind is WASMTIME_F32.
Definition: val.h:325
int64_t i64
Field used if wasmtime_val_t::kind is WASMTIME_I64.
Definition: val.h:323
float64_t f64
Field used if wasmtime_val_t::kind is WASMTIME_F64.
Definition: val.h:327
wasmtime_anyref_t anyref
Field used if wasmtime_val_t::kind is WASMTIME_ANYREF.
Definition: val.h:329
wasmtime_externref_t externref
Field used if wasmtime_val_t::kind is WASMTIME_EXTERNREF.
Definition: val.h:331
uint8_t wasmtime_valkind_t
Discriminant stored in wasmtime_val::kind.
Definition: val.h:284
uint32_t wasmtime_externref_to_raw(wasmtime_context_t *context, const wasmtime_externref_t *ref)
Converts a wasmtime_externref_t to a raw value suitable for storing into a wasmtime_val_raw_t.
struct wasmtime_externref wasmtime_externref_t
Convenience alias for wasmtime_externref.
void wasmtime_anyref_unroot(wasmtime_context_t *context, wasmtime_anyref_t *ref)
Unroots the ref provided within the context.
void * wasmtime_externref_data(wasmtime_context_t *context, const wasmtime_externref_t *data)
Get an externref's wrapped data.
void wasmtime_anyref_from_i31(wasmtime_context_t *context, uint32_t i31val, wasmtime_anyref_t *out)
Create a new i31ref value.
union wasmtime_valunion wasmtime_valunion_t
Convenience alias for wasmtime_valunion.
void wasmtime_val_clone(wasmtime_context_t *context, const wasmtime_val_t *src, wasmtime_val_t *dst)
Clones the value pointed to by src into the dst provided.
void wasmtime_anyref_clone(wasmtime_context_t *context, const wasmtime_anyref_t *anyref, wasmtime_anyref_t *out)
Creates a new reference pointing to the same data that anyref points to (depending on the configured ...
union wasmtime_val_raw wasmtime_val_raw_t
Convenience alias for wasmtime_val_raw.
uint8_t wasmtime_v128[16]
A 128-bit value representing the WebAssembly v128 type. Bytes are stored in little-endian order.
Definition: val.h:307
void wasmtime_externref_from_raw(wasmtime_context_t *context, uint32_t raw, wasmtime_externref_t *out)
Converts a raw externref value coming from wasmtime_val_raw_t into a wasmtime_externref_t.
bool wasmtime_anyref_i31_get_s(wasmtime_context_t *context, const wasmtime_anyref_t *anyref, int32_t *dst)
Get the anyref's underlying i31ref value, sign extended, if any.
void wasmtime_externref_unroot(wasmtime_context_t *context, wasmtime_externref_t *ref)
Unroots the pointer ref from the context provided.
struct wasmtime_val wasmtime_val_t
Convenience alias for wasmtime_val_t.
bool wasmtime_anyref_i31_get_u(wasmtime_context_t *context, const wasmtime_anyref_t *anyref, uint32_t *dst)
Get the anyref's underlying i31ref value, zero extended, if any.
bool wasmtime_externref_new(wasmtime_context_t *context, void *data, void(*finalizer)(void *), wasmtime_externref_t *out)
Create a new externref value.
void wasmtime_val_unroot(wasmtime_context_t *context, wasmtime_val_t *val)
Unroot the value contained by val.
void wasmtime_anyref_from_raw(wasmtime_context_t *context, uint32_t raw, wasmtime_anyref_t *out)
Converts a raw anyref value coming from wasmtime_val_raw_t into a wasmtime_anyref_t.
uint32_t wasmtime_anyref_to_raw(wasmtime_context_t *context, const wasmtime_anyref_t *ref)
Converts a wasmtime_anyref_t to a raw value suitable for storing into a wasmtime_val_raw_t.
void wasmtime_externref_clone(wasmtime_context_t *context, const wasmtime_externref_t *ref, wasmtime_externref_t *out)
Creates a new reference pointing to the same data that ref points to (depending on the configured col...
struct wasmtime_anyref wasmtime_anyref_t
Convenience alias for wasmtime_anyref.
float float32_t
A type definition for a 32-bit float.
Definition: wasm.h:44
double float64_t
A type definition for a 64-bit float.
Definition: wasm.h:45