wasmtime_anyref class final

\typedef wasmtime_anyref_t \brief Convenience alias for #wasmtime_anyref

\struct wasmtime_anyref \brief A WebAssembly value in the any hierarchy of GC types.

This structure represents an anyref that WebAssembly can create and pass back to the host. The host can also create values to pass to a guest.

Note that this structure does not itself contain the data that it refers to. Instead to contains metadata to point back within a #wasmtime_context_t, so referencing the internal data requires using a wasmtime_context_t.

Anyref values are required to be explicitly unrooted via wasmtime_anyref_unroot to enable them to be garbage-collected.

If you do not unroot the value, even if you free the corresponding Store, there will be some memory leaked, because GC roots use a separate allocation to track liveness.

Null anyref values are represented by this structure and can be tested and created with the wasmtime_anyref_is_null and wasmtime_anyref_set_null functions.

Inheritance
Implemented types
Available extensions

Constructors

wasmtime_anyref()

Properties

address → Pointer<T>

Available on T, provided by the StructAddress extension

The memory address of the underlying data.
no setter
hashCode → int
The hash code for this object.
no setterinherited
privateData1 ↔ int
Internal to Wasmtime.
getter/setter pair
privateData2 ↔ int
Internal to Wasmtime.
getter/setter pair
privateData3 ↔ Pointer<Void>
Internal to Wasmtime.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
store_id ↔ int
Internal metadata tracking within the store, embedders should not configure or modify these fields.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

$allocate(Allocator $allocator, {required int store_id, required int privateData1, required int privateData2, required Pointer<Void> privateData3}) → Pointer<wasmtime_anyref_t>