diff --git a/src/Config.cs b/src/Config.cs index e22974d9..8e136f23 100644 --- a/src/Config.cs +++ b/src/Config.cs @@ -257,6 +257,17 @@ public Config WithWideArithmetic(bool enable) return this; } + /// + /// Sets whether the WebAssembly branch-hinting proposal is enabled. + /// + /// True to enable WebAssembly branch hinting support or false to disable. + /// Returns the current config. + public Config WithBranchHinting(bool enable) + { + Native.wasmtime_config_wasm_branch_hinting_set(handle, enable); + return this; + } + /// /// Configures whether the WebAssembly exceptions proposal is enabled. /// @@ -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); diff --git a/tests/ConfigTests.cs b/tests/ConfigTests.cs index a779d0f1..b83d22ae 100644 --- a/tests/ConfigTests.cs +++ b/tests/ConfigTests.cs @@ -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() {