Show / Hide Table of Contents

Class Config

Represents a configuration used to create Engine instances.

Inheritance
System.Object
Config
Namespace: Wasmtime
Assembly: Wasmtime.Dotnet.dll
Syntax
public class Config : IDisposable

Constructors

| Improve this Doc View Source

Config()

Creates a new configuration.

Declaration
public Config()

Methods

| Improve this Doc View Source

Dispose()

Declaration
public void Dispose()
| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX