Skip to content
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

Fix changes to Wasmtime C API. #119

Merged
merged 1 commit into from
Jun 14, 2022
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
18 changes: 4 additions & 14 deletions src/Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,7 @@ public Config WithCompilerStrategy(CompilerStrategy strategy)
throw new ArgumentOutOfRangeException(nameof(strategy));
}

var error = Native.wasmtime_config_strategy_set(handle, (byte)strategy);
if (error != IntPtr.Zero)
{
throw WasmtimeException.FromOwnedError(error);
}

Native.wasmtime_config_strategy_set(handle, (byte)strategy);
return this;
}

Expand Down Expand Up @@ -268,12 +263,7 @@ public Config WithProfilingStrategy(ProfilingStrategy strategy)
throw new ArgumentOutOfRangeException(nameof(strategy));
}

var error = Native.wasmtime_config_profiler_set(handle, (byte)strategy);
if (error != IntPtr.Zero)
{
throw WasmtimeException.FromOwnedError(error);
}

Native.wasmtime_config_profiler_set(handle, (byte)strategy);
return this;
}

Expand Down Expand Up @@ -402,7 +392,7 @@ private static class Native
public static extern void wasmtime_config_wasm_multi_memory_set(Handle config, bool enable);

[DllImport(Engine.LibraryName)]
public static extern IntPtr wasmtime_config_strategy_set(Handle config, byte strategy);
public static extern void wasmtime_config_strategy_set(Handle config, byte strategy);

[DllImport(Engine.LibraryName)]
public static extern void wasmtime_config_cranelift_debug_verifier_set(Handle config, bool enable);
Expand All @@ -414,7 +404,7 @@ private static class Native
public static extern void wasmtime_config_cranelift_opt_level_set(Handle config, byte level);

[DllImport(Engine.LibraryName)]
public static extern IntPtr wasmtime_config_profiler_set(Handle config, byte strategy);
public static extern void wasmtime_config_profiler_set(Handle config, byte strategy);

[DllImport(Engine.LibraryName)]
public static extern void wasmtime_config_static_memory_maximum_size_set(Handle config, ulong size);
Expand Down