Wasmtime
store.h
Go to the documentation of this file.
1
7#ifndef WASMTIME_STORE_H
8#define WASMTIME_STORE_H
9
10#include <wasi.h>
11#include <wasm.h>
12#include <wasmtime/error.h>
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
37
58
72 void *data,
73 void (*finalizer)(void *));
74
78WASM_API_EXTERN wasmtime_context_t *
80
110WASM_API_EXTERN void wasmtime_store_limiter(wasmtime_store_t *store,
111 int64_t memory_size,
112 int64_t table_elements,
113 int64_t instances, int64_t tables,
114 int64_t memories);
115
119WASM_API_EXTERN void wasmtime_store_delete(wasmtime_store_t *store);
120
124WASM_API_EXTERN void *
126
134WASM_API_EXTERN void wasmtime_context_set_data(wasmtime_context_t *context,
135 void *data);
136
146WASM_API_EXTERN void wasmtime_context_gc(wasmtime_context_t *context);
147
162WASM_API_EXTERN wasmtime_error_t *
164
175WASM_API_EXTERN wasmtime_error_t *
176wasmtime_context_get_fuel(const wasmtime_context_t *context, uint64_t *fuel);
177
189WASM_API_EXTERN wasmtime_error_t *
191
202WASM_API_EXTERN void
204 uint64_t ticks_beyond_current);
205
209#define WASMTIME_UPDATE_DEADLINE_CONTINUE 0
211#define WASMTIME_UPDATE_DEADLINE_YIELD 1
212
234 wasmtime_store_t *store,
235 wasmtime_error_t *(*func)(wasmtime_context_t *context, void *data,
236 uint64_t *epoch_deadline_delta,
238 void *data, void (*finalizer)(void *));
239
240#ifdef __cplusplus
241} // extern "C"
242#endif
243
244#endif // WASMTIME_STORE_H
Definition and accessors of wasmtime_error_t.
void wasmtime_store_limiter(wasmtime_store_t *store, int64_t memory_size, int64_t table_elements, int64_t instances, int64_t tables, int64_t memories)
Provides limits for a store. Used by hosts to limit resource consumption of instances....
void wasmtime_context_set_data(wasmtime_context_t *context, void *data)
Overwrites the user-specified data associated with this store.
uint8_t wasmtime_update_deadline_kind_t
An enum for the behavior before extending the epoch deadline.
Definition: store.h:207
void wasmtime_store_epoch_deadline_callback(wasmtime_store_t *store, wasmtime_error_t *(*func)(wasmtime_context_t *context, void *data, uint64_t *epoch_deadline_delta, wasmtime_update_deadline_kind_t *update_kind), void *data, void(*finalizer)(void *))
Configures epoch deadline callback to C function.
void wasmtime_context_gc(wasmtime_context_t *context)
Perform garbage collection within the given context.
void wasmtime_store_delete(wasmtime_store_t *store)
Deletes a store.
void wasmtime_context_set_epoch_deadline(wasmtime_context_t *context, uint64_t ticks_beyond_current)
Configures the relative deadline at which point WebAssembly code will trap or invoke the callback fun...
wasmtime_context_t * wasmtime_store_context(wasmtime_store_t *store)
Returns the interior wasmtime_context_t pointer to this store.
void * wasmtime_context_get_data(const wasmtime_context_t *context)
Returns the user-specified data associated with the specified store.
wasmtime_store_t * wasmtime_store_new(wasm_engine_t *engine, void *data, void(*finalizer)(void *))
Creates a new store within the specified engine.
wasmtime_error_t * wasmtime_context_set_fuel(wasmtime_context_t *store, uint64_t fuel)
Set fuel to this context's store for wasm to consume while executing.
wasmtime_error_t * wasmtime_context_set_wasi(wasmtime_context_t *context, wasi_config_t *wasi)
Configures WASI state within the specified store.
wasmtime_error_t * wasmtime_context_get_fuel(const wasmtime_context_t *context, uint64_t *fuel)
Returns the amount of fuel remaining in this context's store.
Compilation environment and configuration.
An interior pointer into a wasmtime_store_t which is used as "context" for many functions.
Errors generated by Wasmtime.
Storage of WebAssembly objects.