WasmRuntimeOptions Class

Options of a WasmRuntime.

public sealed class WasmRuntimeOptions

Constructors

NameDescription
WasmRuntimeOptions()

WasmRuntimeOptions()

WasmRuntimeOptions.cs
public WasmRuntimeOptions()

No documentation is available.

Properties

NameDescription
CompilationThresholdGets the number of calls after which a function is compiled to .NET code, when the platform supports dynamic code (see RuntimeFeature.IsDynamicCodeSupported); before, and on the platforms that do not support it (Native AOT), the function is interpreted. The default is 100; 0 compiles the functions on their first call, and a negative value disables the compilation. A running call whose loops ran 100 times this number of iterations continues in .NET code (on-stack replacement).
InterruptionCheckIntervalGets the interval at which the running WebAssembly code calls WasmStoreOptions.CheckInterrupt. The default is 10 milliseconds. The timer of the runtime runs only while a store with a WasmStoreOptions.CheckInterrupt action exists (it is not disposed or collected).
MaxMemorySizeGets the maximum size of a memory, in bytes. The default and the upper limit is the maximum length of a .NET array (the bytes of the memories are .NET arrays): a memory that would be larger cannot grow. The bytes of a shared memory are allocated for its maximum size, limited by this value: a shared memory cannot grow beyond.
MaxStackSizeGets the maximum size of the stack of the WebAssembly code, in bytes. The default is 512 KiB. A deeper recursion traps with WasmTrapKind.StackOverflow.
MeterFactoryGets the factory of the Meter of the metrics of the runtime (see the Meziantou.Framework.WasmEngine meter), or null to use a meter shared by the runtimes.

CompilationThreshold

WasmRuntimeOptions.cs

Gets the number of calls after which a function is compiled to .NET code, when the platform supports dynamic code (see RuntimeFeature.IsDynamicCodeSupported); before, and on the platforms that do not support it (Native AOT), the function is interpreted. The default is 100; 0 compiles the functions on their first call, and a negative value disables the compilation. A running call whose loops ran 100 times this number of iterations continues in .NET code (on-stack replacement).

public int CompilationThreshold { get; init; }

Property value

int

InterruptionCheckInterval

WasmRuntimeOptions.cs

Gets the interval at which the running WebAssembly code calls WasmStoreOptions.CheckInterrupt. The default is 10 milliseconds. The timer of the runtime runs only while a store with a WasmStoreOptions.CheckInterrupt action exists (it is not disposed or collected).

public TimeSpan InterruptionCheckInterval { get; init; }

Property value

TimeSpan

Gets the maximum size of a memory, in bytes. The default and the upper limit is the maximum length of a .NET array (the bytes of the memories are .NET arrays): a memory that would be larger cannot grow. The bytes of a shared memory are allocated for its maximum size, limited by this value: a shared memory cannot grow beyond.

public long MaxMemorySize { get; init; }

Property value

long

Gets the maximum size of the stack of the WebAssembly code, in bytes. The default is 512 KiB. A deeper recursion traps with WasmTrapKind.StackOverflow.

public int MaxStackSize { get; init; }

Property value

int

Gets the factory of the Meter of the metrics of the runtime (see the Meziantou.Framework.WasmEngine meter), or null to use a meter shared by the runtimes.

public IMeterFactory? MeterFactory { get; init; }

Property value

IMeterFactory?