Skip to content
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
14 changes: 14 additions & 0 deletions src/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,17 @@ public Config WithWideArithmetic(bool enable)
return this;
}

/// <summary>
/// Sets whether the WebAssembly branch-hinting proposal is enabled.
/// </summary>
/// <param name="enable">True to enable WebAssembly branch hinting support or false to disable.</param>
/// <returns>Returns the current config.</returns>
public Config WithBranchHinting(bool enable)
{
Native.wasmtime_config_wasm_branch_hinting_set(handle, enable);
return this;
}

/// <summary>
/// Configures whether the WebAssembly exceptions proposal is enabled.
/// </summary>
Expand Down Expand Up @@ -595,6 +606,9 @@ private static class Native
[DllImport(Engine.LibraryName)]
public static extern void wasmtime_config_wasm_wide_arithmetic_set(Handle config, [MarshalAs(UnmanagedType.I1)] bool enable);

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

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

Expand Down
10 changes: 10 additions & 0 deletions tests/ConfigTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,16 @@ public void ItSetsWideArithmetic()
using var engine = new Engine(config);
}

[Fact]
public void ItSetsBranchHinting()
{
var config = new Config();

config.WithBranchHinting(true);

using var engine = new Engine(config);
}

[Fact]
public void ItSetsThreads()
{
Expand Down
Loading