Skip to content

Commit 32aac52

Browse files
authored
Added WithMacosMachPorts config option (#295)
1 parent f48c2cc commit 32aac52

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/Config.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,20 @@ public Config WithCacheConfig(string? path)
343343
return this;
344344
}
345345

346+
/// <summary>
347+
/// Configures whether, when on macOS, Mach ports are used for exception handling
348+
/// instead of traditional Unix-based signal handling.
349+
///
350+
/// This option defaults to true, using Mach ports by default.
351+
/// </summary>
352+
/// <param name="enable">True to enable Mach ports or false to disable.</param>
353+
/// <returns>Returns the current config.</returns>
354+
public Config WithMacosMachPorts(bool enable)
355+
{
356+
Native.wasmtime_config_macos_use_mach_ports(handle, enable);
357+
return this;
358+
}
359+
346360
/// <inheritdoc/>
347361
public void Dispose()
348362
{
@@ -450,6 +464,9 @@ private static class Native
450464

451465
[DllImport(Engine.LibraryName)]
452466
public static extern IntPtr wasmtime_config_cache_config_load(Handle config, [MarshalAs(Extensions.LPUTF8Str)] string? path);
467+
468+
[DllImport(Engine.LibraryName)]
469+
public static extern void wasmtime_config_macos_use_mach_ports(Handle config, [MarshalAs(UnmanagedType.I1)] bool enable);
453470
}
454471

455472
private readonly Handle handle;

0 commit comments

Comments
 (0)