Skip to content

Added WithMacosMachPorts config option #295

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

Merged
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
17 changes: 17 additions & 0 deletions src/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,20 @@ public Config WithCacheConfig(string? path)
return this;
}

/// <summary>
/// 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.
/// </summary>
/// <param name="enable">True to enable Mach ports or false to disable.</param>
/// <returns>Returns the current config.</returns>
public Config WithMacosMachPorts(bool enable)
{
Native.wasmtime_config_macos_use_mach_ports(handle, enable);
return this;
}

/// <inheritdoc/>
public void Dispose()
{
Expand Down Expand Up @@ -450,6 +464,9 @@ private static class Native

[DllImport(Engine.LibraryName)]
public static extern IntPtr wasmtime_config_cache_config_load(Handle config, [MarshalAs(Extensions.LPUTF8Str)] string? path);

[DllImport(Engine.LibraryName)]
public static extern void wasmtime_config_macos_use_mach_ports(Handle config, [MarshalAs(UnmanagedType.I1)] bool enable);
}

private readonly Handle handle;
Expand Down