Change wasm_module_new to use Module::from_binary.
This commit changes the C API function `wasm_module_new` to use the Rust API `Module::from_binary` which performs verification of the module, as per the C API spec. This also introduces a `EngineBuilder` type to the C# API that can be used to construct an `Engine` with the various Wasmtime configuration options. This is required to get the C# tests passing since they use reference types and multi-value. Fixes #859.
This commit is contained in:
@@ -20,6 +20,17 @@ namespace Wasmtime
|
||||
}
|
||||
}
|
||||
|
||||
internal Engine(Interop.WasmConfigHandle config)
|
||||
{
|
||||
Handle = Interop.wasm_engine_new_with_config(config);
|
||||
config.SetHandleAsInvalid();
|
||||
|
||||
if (Handle.IsInvalid)
|
||||
{
|
||||
throw new WasmtimeException("Failed to create Wasmtime engine.");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new Wasmtime <see cref="Store" />.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user