From bec30581ef1af28b7dd00a6630ce819b8885ab04 Mon Sep 17 00:00:00 2001 From: Wolfgang Meier Date: Wed, 24 Jan 2024 20:43:44 +0100 Subject: [PATCH] expose tail call configuration option to c api --- crates/c-api/include/wasmtime/config.h | 7 +++++++ crates/c-api/src/config.rs | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/crates/c-api/include/wasmtime/config.h b/crates/c-api/include/wasmtime/config.h index 9bd2a4e7ef04..98e3cd048b60 100644 --- a/crates/c-api/include/wasmtime/config.h +++ b/crates/c-api/include/wasmtime/config.h @@ -149,6 +149,13 @@ WASMTIME_CONFIG_PROP(void, max_wasm_stack, size_t) */ WASMTIME_CONFIG_PROP(void, wasm_threads, bool) +/** + * \brief Configures whether the WebAssembly tail call proposal is enabled. + * + * This setting is `false` by default. + */ +WASMTIME_CONFIG_PROP(void, wasm_tail_call, bool) + /** * \brief Configures whether the WebAssembly reference types proposal is * enabled. diff --git a/crates/c-api/src/config.rs b/crates/c-api/src/config.rs index a2c40481069f..19fcda036c00 100644 --- a/crates/c-api/src/config.rs +++ b/crates/c-api/src/config.rs @@ -75,6 +75,11 @@ pub extern "C" fn wasmtime_config_wasm_threads_set(c: &mut wasm_config_t, enable c.config.wasm_threads(enable); } +#[no_mangle] +pub extern "C" fn wasmtime_config_wasm_tail_call_set(c: &mut wasm_config_t, enable: bool) { + c.config.wasm_tail_call(enable); +} + #[no_mangle] pub extern "C" fn wasmtime_config_wasm_reference_types_set(c: &mut wasm_config_t, enable: bool) { c.config.wasm_reference_types(enable);