Wasmtime
store.h
Go to the documentation of this file.
1
7#ifndef WASMTIME_STORE_H
8#define WASMTIME_STORE_H
9
10#include <wasm.h>
11#include <wasi.h>
12#include <wasmtime/error.h>
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
37
58
72 wasm_engine_t *engine,
73 void *data,
74 void (*finalizer)(void*)
75);
76
81
85WASM_API_EXTERN void wasmtime_store_delete(wasmtime_store_t *store);
86
90WASM_API_EXTERN void *wasmtime_context_get_data(const wasmtime_context_t* context);
91
99WASM_API_EXTERN void wasmtime_context_set_data(wasmtime_context_t* context, void *data);
100
110WASM_API_EXTERN void wasmtime_context_gc(wasmtime_context_t* context);
111
127WASM_API_EXTERN wasmtime_error_t *wasmtime_context_add_fuel(wasmtime_context_t *store, uint64_t fuel);
128
140WASM_API_EXTERN bool wasmtime_context_fuel_consumed(const wasmtime_context_t *context, uint64_t *fuel);
141
154WASM_API_EXTERN wasmtime_error_t *wasmtime_context_consume_fuel(wasmtime_context_t *context, uint64_t fuel, uint64_t *remaining);
155
168
178WASM_API_EXTERN void wasmtime_context_set_epoch_deadline(wasmtime_context_t *context, uint64_t ticks_beyond_current);
179
180#ifdef __cplusplus
181} // extern "C"
182#endif
183
184#endif // WASMTIME_STORE_H
185
Definition and accessors of wasmtime_error_t.
void wasmtime_context_set_data(wasmtime_context_t *context, void *data)
Overwrites the user-specified data associated with this store.
wasmtime_error_t * wasmtime_context_add_fuel(wasmtime_context_t *store, uint64_t fuel)
Adds fuel to this context's store for wasm to consume while executing.
wasmtime_error_t * wasmtime_context_consume_fuel(wasmtime_context_t *context, uint64_t fuel, uint64_t *remaining)
Attempt to manually consume fuel from the store.
void wasmtime_context_gc(wasmtime_context_t *context)
Perform garbage collection within the given context.
bool wasmtime_context_fuel_consumed(const wasmtime_context_t *context, uint64_t *fuel)
Returns the amount of fuel consumed by this context's store execution so far.
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.
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_wasi(wasmtime_context_t *context, wasi_config_t *wasi)
Configures WASI state within the specified 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.