Skip to content

Commit

Permalink
expose tail call configuration option to c api (#7811)
Browse files Browse the repository at this point in the history
  • Loading branch information
womeier authored Jan 24, 2024
1 parent 5f6288f commit 3e68c4a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions crates/c-api/include/wasmtime/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 5 additions & 0 deletions crates/c-api/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3e68c4a

Please sign in to comment.