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/conf.h>
13#include <wasmtime/error.h>
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
38
59
73 void *data,
74 void (*finalizer)(void *));
75
79WASM_API_EXTERN wasmtime_context_t *
81
111WASM_API_EXTERN void wasmtime_store_limiter(wasmtime_store_t *store,
112 int64_t memory_size,
113 int64_t table_elements,
114 int64_t instances, int64_t tables,
115 int64_t memories);
116
120WASM_API_EXTERN void wasmtime_store_delete(wasmtime_store_t *store);
121
125WASM_API_EXTERN void *
127
135WASM_API_EXTERN void wasmtime_context_set_data(wasmtime_context_t *context,
136 void *data);
137
147WASM_API_EXTERN void wasmtime_context_gc(wasmtime_context_t *context);
148
163WASM_API_EXTERN wasmtime_error_t *
165
176WASM_API_EXTERN wasmtime_error_t *
177wasmtime_context_get_fuel(const wasmtime_context_t *context, uint64_t *fuel);
178
179#ifdef WASMTIME_FEATURE_WASI
180
192WASM_API_EXTERN wasmtime_error_t *
194
195#endif // WASMTIME_FEATURE_WASI
196
207WASM_API_EXTERN void
209 uint64_t ticks_beyond_current);
210
214#define WASMTIME_UPDATE_DEADLINE_CONTINUE 0
216#define WASMTIME_UPDATE_DEADLINE_YIELD 1
217
239 wasmtime_store_t *store,
240 wasmtime_error_t *(*func)(wasmtime_context_t *context, void *data,
241 uint64_t *epoch_deadline_delta,
243 void *data, void (*finalizer)(void *));
244
245#ifdef __cplusplus
246} // extern "C"
247#endif
248
249#endif // WASMTIME_STORE_H
Build-time defines for how the C API was built.
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:212
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.