Wasmtime
engine.hh
Go to the documentation of this file.
1
5#ifndef WASMTIME_ENGINE_HH
6#define WASMTIME_ENGINE_HH
7
8#include <memory>
9#include <wasmtime/config.hh>
10#include <wasmtime/engine.h>
11#include <wasmtime/helpers.hh>
12
13namespace wasmtime {
14
22class Engine {
24#define wasm_engine_clone wasmtime_engine_clone
25 WASMTIME_CLONE_WRAPPER(Engine, wasm_engine);
26#undef wasm_engine_clone
27
29 Engine() : ptr(wasm_engine_new()) {}
31 explicit Engine(Config config)
32 : ptr(wasm_engine_new_with_config(config.capi_release())) {}
33
37 void increment_epoch() const { wasmtime_engine_increment_epoch(ptr.get()); }
38
40 void is_pulley() const { wasmtime_engine_is_pulley(ptr.get()); }
41};
42
43} // namespace wasmtime
44
45#endif // WASMTIME_ENGINE_HH
Global compilation state in Wasmtime.
Definition: engine.hh:22
WASM_API_EXTERN bool wasmtime_engine_is_pulley(wasm_engine_t *engine)
Returns whether this engine is using the Pulley interpreter to execute WebAssembly code.
WASM_API_EXTERN void wasmtime_engine_increment_epoch(wasm_engine_t *engine)
Increments the engine-local epoch variable.
wasm_engine_t * wasm_engine_new(void)
Creates a new engine with the default configuration.
wasm_engine_t * wasm_engine_new_with_config(wasm_config_t *)
Creates a new engine with the specified configuration.