|
Wasmtime
|
Go to the source code of this file.
Typedefs | |
| typedef struct wasmtime_array_ref_pre | wasmtime_array_ref_pre_t |
| An opaque pre-allocated array layout for fast allocation. More... | |
Functions | |
| WASM_API_EXTERN wasmtime_array_ref_pre_t * | wasmtime_array_ref_pre_new (wasmtime_context_t *context, const wasmtime_array_type_t *ty) |
| Create a new array pre-allocator. More... | |
| WASM_API_EXTERN void | wasmtime_array_ref_pre_delete (wasmtime_array_ref_pre_t *pre) |
| Delete an array pre-allocator. | |
| WASM_API_EXTERN wasmtime_error_t * | wasmtime_arrayref_new (wasmtime_context_t *context, const wasmtime_array_ref_pre_t *pre, const wasmtime_val_t *elem, uint32_t len, wasmtime_arrayref_t *out) |
| Allocate a new array instance. More... | |
| WASM_API_EXTERN void | wasmtime_arrayref_clone (const wasmtime_arrayref_t *arrayref, wasmtime_arrayref_t *out) |
Clone an arrayref, creating a new root. | |
| WASM_API_EXTERN void | wasmtime_arrayref_unroot (wasmtime_arrayref_t *ref) |
Unroot an arrayref to allow garbage collection. | |
| WASM_API_EXTERN void | wasmtime_arrayref_to_anyref (const wasmtime_arrayref_t *arrayref, wasmtime_anyref_t *out) |
Upcast an arrayref to an anyref. | |
| WASM_API_EXTERN void | wasmtime_arrayref_to_eqref (const wasmtime_arrayref_t *arrayref, wasmtime_eqref_t *out) |
Upcast an arrayref to an eqref. | |
| WASM_API_EXTERN wasmtime_error_t * | wasmtime_arrayref_len (wasmtime_context_t *context, const wasmtime_arrayref_t *arrayref, uint32_t *out) |
| Get the length of an array. More... | |
| WASM_API_EXTERN wasmtime_error_t * | wasmtime_arrayref_get (wasmtime_context_t *context, const wasmtime_arrayref_t *arrayref, uint32_t index, wasmtime_val_t *out) |
| Read an element from an array. More... | |
| WASM_API_EXTERN wasmtime_error_t * | wasmtime_arrayref_set (wasmtime_context_t *context, const wasmtime_arrayref_t *arrayref, uint32_t index, const wasmtime_val_t *val) |
| Set an element of an array. More... | |
APIs for interacting with WebAssembly arrayref type in Wasmtime.
| typedef struct wasmtime_array_ref_pre wasmtime_array_ref_pre_t |
An opaque pre-allocated array layout for fast allocation.
Created from a wasmtime_array_type_t and a store context. Reusable for allocating many array instances of the same type.
Owned. Must be deleted with wasmtime_array_ref_pre_delete.
| WASM_API_EXTERN wasmtime_array_ref_pre_t * wasmtime_array_ref_pre_new | ( | wasmtime_context_t * | context, |
| const wasmtime_array_type_t * | ty | ||
| ) |
Create a new array pre-allocator.
| context | The store context. |
| ty | The array type (not consumed; caller retains ownership). |
| WASM_API_EXTERN wasmtime_error_t * wasmtime_arrayref_get | ( | wasmtime_context_t * | context, |
| const wasmtime_arrayref_t * | arrayref, | ||
| uint32_t | index, | ||
| wasmtime_val_t * | out | ||
| ) |
Read an element from an array.
| context | The store context. |
| arrayref | The array (not consumed). |
| index | The element index. |
| out | Receives the element value on success. |
| WASM_API_EXTERN wasmtime_error_t * wasmtime_arrayref_len | ( | wasmtime_context_t * | context, |
| const wasmtime_arrayref_t * | arrayref, | ||
| uint32_t * | out | ||
| ) |
Get the length of an array.
| context | The store context. |
| arrayref | The array (not consumed). |
| out | Receives the length on success. |
| WASM_API_EXTERN wasmtime_error_t * wasmtime_arrayref_new | ( | wasmtime_context_t * | context, |
| const wasmtime_array_ref_pre_t * | pre, | ||
| const wasmtime_val_t * | elem, | ||
| uint32_t | len, | ||
| wasmtime_arrayref_t * | out | ||
| ) |
Allocate a new array instance.
All elements are initialized to the same value.
| context | The store context. |
| pre | The array pre-allocator. |
| elem | The initial element value. |
| len | The number of elements. |
| out | Receives the new arrayref on success. |
| WASM_API_EXTERN wasmtime_error_t * wasmtime_arrayref_set | ( | wasmtime_context_t * | context, |
| const wasmtime_arrayref_t * | arrayref, | ||
| uint32_t | index, | ||
| const wasmtime_val_t * | val | ||
| ) |
Set an element of an array.
| context | The store context. |
| arrayref | The array (not consumed). |
| index | The element index. |
| val | The value to write. |