Browse Source

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

pull/7599/head
Caio Ramos Casimiro 11 months ago
committed by GitHub
parent
commit
1c7a07b326
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      crates/c-api/include/wasmtime/config.h
  2. 5
      crates/c-api/src/config.rs

11
crates/c-api/include/wasmtime/config.h

@ -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); 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. * Return the data from a LinearMemory instance.

5
crates/c-api/src/config.rs

@ -240,6 +240,11 @@ pub unsafe extern "C" fn wasmtime_config_target_set(
handle_result(c.config.target(target), |_cfg| {}) 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] #[no_mangle]
pub unsafe extern "C" fn wasmtime_config_cranelift_flag_enable( pub unsafe extern "C" fn wasmtime_config_cranelift_flag_enable(
c: &mut wasm_config_t, c: &mut wasm_config_t,

Loading…
Cancel
Save