Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

c-api: support disabling mach ports use on macos #7595

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions crates/c-api/include/wasmtime/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,17 @@ WASM_API_EXTERN void wasmtime_config_cranelift_flag_enable(wasm_config_t*, const
*/
WASM_API_EXTERN void wasmtime_config_cranelift_flag_set(wasm_config_t*, const char *key, const char *value);

/**
* \brief Configures whether, when on macOS, Mach ports are used for exception handling
* instead of traditional Unix-based signal handling.
*
* This option defaults to true, using Mach ports by default.
*
* For more information see the Rust documentation at
* https://docs.wasmtime.dev/api/wasmtime/struct.Config.html#method.macos_use_mach_ports
*/
WASMTIME_CONFIG_PROP(void, macos_use_mach_ports, bool)


/**
* Return the data from a LinearMemory instance.
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 @@ -240,6 +240,11 @@ pub unsafe extern "C" fn wasmtime_config_target_set(
handle_result(c.config.target(target), |_cfg| {})
}

#[no_mangle]
pub extern "C" fn wasmtime_config_macos_use_mach_ports_set(c: &mut wasm_config_t, enabled: bool) {
c.config.macos_use_mach_ports(enabled);
}

#[no_mangle]
pub unsafe extern "C" fn wasmtime_config_cranelift_flag_enable(
c: &mut wasm_config_t,
Expand Down