Class Config
Represents a configuration used to create Engine instances.
Inheritance
Namespace: Wasmtime
Assembly: Wasmtime.Dotnet.dll
Syntax
public class Config : IDisposable
Constructors
| Improve this Doc View SourceConfig()
Creates a new configuration.
Declaration
public Config()
Methods
| Improve this Doc View SourceDispose()
Declaration
public void Dispose()
WithBulkMemory(Boolean)
Sets whether or not enable WebAssembly bulk memory support.
Declaration
public Config WithBulkMemory(bool enable)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | enable | True to enable WebAssembly bulk memory support or false to disable. |
Returns
Type | Description |
---|---|
Config | Returns the current config. |
WithCacheConfig(Nullable<String>)
Sets the path to the Wasmtime cache configuration to use.
Declaration
public Config WithCacheConfig(string? path)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.String> | path | The path to the cache configuration file to use or null to load the default configuration. |
Returns
Type | Description |
---|---|
Config | Returns the current config. |
Remarks
If the path is null, the default Wasmtime cache configuration will be used.
WithCompilerStrategy(CompilerStrategy)
Sets the compiler strategy to use.
Declaration
public Config WithCompilerStrategy(CompilerStrategy strategy)
Parameters
Type | Name | Description |
---|---|---|
CompilerStrategy | strategy | The compiler strategy to use. |
Returns
Type | Description |
---|---|
Config | Returns the current config. |
WithCraneliftDebugVerifier(Boolean)
Sets whether or not enable the Cranelift debug verifier.
Declaration
public Config WithCraneliftDebugVerifier(bool enable)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | enable | True to enable the Cranelift debug verifier or false to disable. |
Returns
Type | Description |
---|---|
Config | Returns the current config. |
WithCraneliftNaNCanonicalization(Boolean)
Configures whether Cranelift should perform a NaN-canonicalization pass.
When Cranelift is used as a code generation backend this will configure it to replace NaNs with a single canonical value.This is useful for users requiring entirely deterministic WebAssembly computation.
This is not required by the WebAssembly spec, so it is not enabled by default.
The default value for this is false
Declaration
public Config WithCraneliftNaNCanonicalization(bool enable)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | enable | True to enable the Cranelift nan canonicalization or false to disable. |
Returns
Type | Description |
---|---|
Config | Returns the current config. |
WithDebugInfo(Boolean)
Sets whether or not to enable debug information.
Declaration
public Config WithDebugInfo(bool enable)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | enable | True to enable debug information or false to disable. |
Returns
Type | Description |
---|---|
Config | Returns the current config. |
WithDynamicMemoryGuardSize(UInt64)
Sets the maximum size of the guard region for dynamic WebAssembly linear memories.
Declaration
public Config WithDynamicMemoryGuardSize(ulong size)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | size | The maximum guard region size for dynamic WebAssembly linear memories, in bytes. |
Returns
Type | Description |
---|---|
Config | Returns the current config. |
WithEpochInterruption(Boolean)
Sets whether or not to enable epoch-based interruption of WebAssembly code.
Declaration
public Config WithEpochInterruption(bool enable)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | enable | True to enable epoch-based interruption or false to disable. |
Returns
Type | Description |
---|---|
Config | Returns the current config. |
WithFuelConsumption(Boolean)
Sets whether or not to enable fuel consumption for WebAssembly code.
Declaration
public Config WithFuelConsumption(bool enable)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | enable | True to enable fuel consumption or false to disable. |
Returns
Type | Description |
---|---|
Config | Returns the current config. |
WithMaximumStackSize(Int32)
Sets the maximum WebAssembly stack size.
Declaration
public Config WithMaximumStackSize(int size)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | size | The maximum WebAssembly stack size, in bytes. |
Returns
Type | Description |
---|---|
Config | Returns the current config. |
WithMemory64(Boolean)
Sets whether or not enable WebAssembly memory64 support.
Declaration
public Config WithMemory64(bool enable)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | enable | True to enable WebAssembly memory64 support or false to disable. |
Returns
Type | Description |
---|---|
Config | Returns the current config. |
WithMultiMemory(Boolean)
Sets whether or not enable WebAssembly multi-memory support.
Declaration
public Config WithMultiMemory(bool enable)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | enable | True to enable WebAssembly multi-memory support or false to disable. |
Returns
Type | Description |
---|---|
Config | Returns the current config. |
WithMultiValue(Boolean)
Sets whether or not enable WebAssembly multi-value support.
Declaration
public Config WithMultiValue(bool enable)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | enable | True to enable WebAssembly multi-value support or false to disable. |
Returns
Type | Description |
---|---|
Config | Returns the current config. |
WithOptimizationLevel(OptimizationLevel)
Sets the optimization level to use.
Declaration
public Config WithOptimizationLevel(OptimizationLevel level)
Parameters
Type | Name | Description |
---|---|---|
OptimizationLevel | level | The optimization level to use. |
Returns
Type | Description |
---|---|
Config | Returns the current config. |
WithProfilingStrategy(ProfilingStrategy)
Sets the profiling strategy to use.
Declaration
public Config WithProfilingStrategy(ProfilingStrategy strategy)
Parameters
Type | Name | Description |
---|---|---|
ProfilingStrategy | strategy | The profiling strategy to use. |
Returns
Type | Description |
---|---|
Config | Returns the current config. |
WithReferenceTypes(Boolean)
Sets whether or not enable WebAssembly reference types support.
Declaration
public Config WithReferenceTypes(bool enable)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | enable | True to enable WebAssembly reference types support or false to disable. |
Returns
Type | Description |
---|---|
Config | Returns the current config. |
WithSIMD(Boolean)
Sets whether or not enable WebAssembly SIMD support.
Declaration
public Config WithSIMD(bool enable)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | enable | True to enable WebAssembly SIMD support or false to disable. |
Returns
Type | Description |
---|---|
Config | Returns the current config. |
WithStaticMemoryGuardSize(UInt64)
Sets the maximum size of the guard region for static WebAssembly linear memories.
Declaration
public Config WithStaticMemoryGuardSize(ulong size)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | size | The maximum guard region size for static WebAssembly linear memories, in bytes. |
Returns
Type | Description |
---|---|
Config | Returns the current config. |
WithStaticMemoryMaximumSize(UInt64)
Sets the maximum size of static WebAssembly linear memories.
Declaration
public Config WithStaticMemoryMaximumSize(ulong size)
Parameters
Type | Name | Description |
---|---|---|
System.UInt64 | size | The maximum size of static WebAssembly linear memories, in bytes. |
Returns
Type | Description |
---|---|
Config | Returns the current config. |
WithWasmThreads(Boolean)
Sets whether or not enable WebAssembly threads support.
Declaration
public Config WithWasmThreads(bool enable)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | enable | True to enable WebAssembly threads support or false to disable. |
Returns
Type | Description |
---|---|
Config | Returns the current config. |