WasmtimeRuntimeOptions Class
Options of a WasmtimeRuntime.
public sealed class WasmtimeRuntimeOptionsConstructors
| Name | Description |
|---|---|
| WasmtimeRuntimeOptions() |
WasmtimeRuntimeOptions()
WasmtimeRuntimeOptions.cspublic WasmtimeRuntimeOptions()No documentation is available.
Properties
| Name | Description |
|---|---|
| InterruptionCheckInterval | Gets the interval at which the running WebAssembly code checks whether it must be interrupted (e.g. the timeout of the script engine). The default is 10 milliseconds. |
| 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 memories are .NET arrays, so that the ArrayBuffer objects of JavaScript share their bytes): 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 throws the exception of a stack overflow of JavaScript (a RangeError). |
| ModuleCacheDirectory | Gets the folder where the compiled code of the modules is saved, to be loaded instead of compiled again when the same module is compiled later, by this runtime or by another one (another test, another run of the tests). The default is null: the modules are compiled each time. Compiling a large module, such as the runtime of .NET in a Blazor WebAssembly application, takes seconds, while loading it from the folder takes milliseconds. |
InterruptionCheckInterval
WasmtimeRuntimeOptions.csMaxMemorySize
WasmtimeRuntimeOptions.csGets the maximum size of a memory, in bytes. The default and the upper limit is the maximum length of a .NET array (the memories are .NET arrays, so that the ArrayBuffer objects of JavaScript share their bytes): 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
WasmtimeRuntimeOptions.csModuleCacheDirectory
WasmtimeRuntimeOptions.csGets the folder where the compiled code of the modules is saved, to be loaded instead of compiled again when the same module is compiled later, by this runtime or by another one (another test, another run of the tests). The default is null: the modules are compiled each time. Compiling a large module, such as the runtime of .NET in a Blazor WebAssembly application, takes seconds, while loading it from the folder takes milliseconds.
public string? ModuleCacheDirectory { get; init; }Property value
Remarks
The files are native code that the runtime loads and runs without validating it: use a folder that only the current user can write to. A file that does not match the version or the configuration of Wasmtime is replaced. The files are never deleted: they are about ten times as large as the modules.