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