1 /**
2  * \file wasmtime/engine.h
3  *
4  * Wasmtime-specific extensions to #wasm_engine_t.
5  */
6 
7 #ifndef WASMTIME_ENGINE_H
8 #define WASMTIME_ENGINE_H
9 
10 #include <wasm.h>
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 /**
17  * \brief Create a new reference to the same underlying engine.
18  *
19  * This function clones the reference-counted pointer to the internal object,
20  * and must be freed using #wasm_engine_delete.
21  */
22 WASM_API_EXTERN wasm_engine_t *wasmtime_engine_clone(wasm_engine_t *engine);
23 
24 /**
25  * \brief Increments the engine-local epoch variable.
26  *
27  * This function will increment the engine's current epoch which can be used to
28  * force WebAssembly code to trap if the current epoch goes beyond the
29  * #wasmtime_store_t configured epoch deadline.
30  *
31  * This function is safe to call from any thread, and it is also
32  * async-signal-safe.
33  *
34  * See also #wasmtime_config_epoch_interruption_set.
35  */
36 WASM_API_EXTERN void wasmtime_engine_increment_epoch(wasm_engine_t *engine);
37 
38 /**
39  * \brief Returns whether this engine is using the Pulley interpreter to execute
40  * WebAssembly code.
41  */
42 WASM_API_EXTERN bool wasmtime_engine_is_pulley(wasm_engine_t *engine);
43 
44 #ifdef __cplusplus
45 } // extern "C"
46 #endif
47 
48 #endif // WASMTIME_ENGINE_H
49