WasmRuntimeOptions Class
Options of a WasmRuntime.
public sealed class WasmRuntimeOptionsConstructors
| Name | Description |
|---|---|
| WasmRuntimeOptions() |
WasmRuntimeOptions()
WasmRuntimeOptions.cspublic WasmRuntimeOptions()No documentation is available.
Properties
| Name | Description |
|---|---|
| CompilationThreshold | 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). |
| InterruptionCheckInterval | 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). |
| MaxMemorySize | 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. |
| MaxStackSize | 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. |
| MeterFactory | 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. |
CompilationThreshold
WasmRuntimeOptions.csGets 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
InterruptionCheckInterval
WasmRuntimeOptions.csGets 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
MaxMemorySize
WasmRuntimeOptions.csGets 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
MaxStackSize
WasmRuntimeOptions.csGets 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
MeterFactory
WasmRuntimeOptions.csGets 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; }