232 void (*finalizer)(
void *),
298#define WASMTIME_I32 0
300#define WASMTIME_I64 1
302#define WASMTIME_F32 2
304#define WASMTIME_F64 3
306#define WASMTIME_V128 4
309#define WASMTIME_FUNCREF 5
312#define WASMTIME_EXTERNREF 6
315#define WASMTIME_ANYREF 7
367static inline bool wasmtime_funcref_is_null(
const wasmtime_func_t *func) {
432static inline void __wasmtime_val_assertions() {
435 "should be 16 bytes plus a pointer large (plus alignment on "
438 "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:43
uint32_t __private1
Internal to Wasmtime.
Definition: val.h:48
void * __private3
Internal to Wasmtime.
Definition: val.h:52
uint32_t __private2
Internal to Wasmtime.
Definition: val.h:50
uint64_t store_id
Definition: val.h:46
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:180
uint64_t store_id
Definition: val.h:183
uint32_t __private2
Internal to Wasmtime.
Definition: val.h:187
void * __private3
Internal to Wasmtime.
Definition: val.h:189
uint32_t __private1
Internal to Wasmtime.
Definition: val.h:185
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:460
wasmtime_valkind_t kind
Discriminant of which field of of is valid.
Definition: val.h:462
wasmtime_valunion_t of
Container for the extern item's value.
Definition: val.h:464
Container for possible wasm values.
Definition: val.h:384
uint32_t anyref
Definition: val.h:412
uint32_t externref
Definition: val.h:420
float32_t f32
Definition: val.h:396
float64_t f64
Definition: val.h:400
int32_t i32
Definition: val.h:388
wasmtime_v128 v128
Definition: val.h:404
int64_t i64
Definition: val.h:392
void * funcref
Definition: val.h:427
Container for different kinds of wasm values.
Definition: val.h:331
wasmtime_func_t funcref
Definition: val.h:348
int32_t i32
Field used if wasmtime_val_t::kind is WASMTIME_I32.
Definition: val.h:333
wasmtime_v128 v128
Field used if wasmtime_val_t::kind is WASMTIME_V128.
Definition: val.h:350
float32_t f32
Field used if wasmtime_val_t::kind is WASMTIME_F32.
Definition: val.h:337
int64_t i64
Field used if wasmtime_val_t::kind is WASMTIME_I64.
Definition: val.h:335
float64_t f64
Field used if wasmtime_val_t::kind is WASMTIME_F64.
Definition: val.h:339
wasmtime_anyref_t anyref
Field used if wasmtime_val_t::kind is WASMTIME_ANYREF.
Definition: val.h:341
wasmtime_externref_t externref
Field used if wasmtime_val_t::kind is WASMTIME_EXTERNREF.
Definition: val.h:343
uint8_t wasmtime_valkind_t
Discriminant stored in wasmtime_val::kind.
Definition: val.h:296
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:319
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