Add Wasmtime C API function to control linker shadowing.
This commit is contained in:
@@ -668,12 +668,14 @@ namespace Wasmtime
|
||||
{
|
||||
CheckDisposed();
|
||||
|
||||
var linker = Interop.wasmtime_linker_new(Store, allowShadowing: true);
|
||||
var linker = Interop.wasmtime_linker_new(Store);
|
||||
if (linker.IsInvalid)
|
||||
{
|
||||
throw new WasmtimeException("Failed to create Wasmtime linker.");
|
||||
}
|
||||
|
||||
Interop.wasmtime_linker_allow_shadowing(linker, allowShadowing: true);
|
||||
|
||||
Linker.Dispose();
|
||||
Linker = linker;
|
||||
}
|
||||
@@ -722,12 +724,14 @@ namespace Wasmtime
|
||||
throw new WasmtimeException("Failed to create Wasmtime store.");
|
||||
}
|
||||
|
||||
var linker = Interop.wasmtime_linker_new(store, allowShadowing: true);
|
||||
var linker = Interop.wasmtime_linker_new(store);
|
||||
if (linker.IsInvalid)
|
||||
{
|
||||
throw new WasmtimeException("Failed to create Wasmtime linker.");
|
||||
}
|
||||
|
||||
Interop.wasmtime_linker_allow_shadowing(linker, allowShadowing: true);
|
||||
|
||||
Engine = engine;
|
||||
Store = store;
|
||||
Linker = linker;
|
||||
|
||||
@@ -1020,7 +1020,10 @@ namespace Wasmtime
|
||||
// Linking functions
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern LinkerHandle wasmtime_linker_new(StoreHandle store, [MarshalAs(UnmanagedType.I1)] bool allowShadowing);
|
||||
public static extern LinkerHandle wasmtime_linker_new(StoreHandle store);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void wasmtime_linker_allow_shadowing(LinkerHandle linker, [MarshalAs(UnmanagedType.I1)] bool allowShadowing);
|
||||
|
||||
[DllImport(LibraryName)]
|
||||
public static extern void wasmtime_linker_delete(IntPtr linker);
|
||||
|
||||
Reference in New Issue
Block a user