WasmtimeRuntime Class
A WebAssemblyRuntime based on Wasmtime (https://wasmtime.dev/): the WebAssembly modules are compiled to native code by Cranelift. Set it in BrowsingContextOptions.WebAssemblyRuntime to define the WebAssembly namespace in the realms of the scripts.
public sealed class WasmtimeRuntime : WebAssemblyRuntime, IDisposableRemarks
The WebAssembly 3.0 features are enabled (the reference types, the GC types, the exceptions, the tail calls, memory64, the multiple memories, the SIMD and relaxed SIMD instructions), and the threads (the shared memories and the atomic instructions).
The bytes of a shared memory are a shared data block of the script engine, allocated for the maximum size of the memory: the agents (the windows and the workers) share the memory, and Atomics.wait and Atomics.notify use the waiters of Wasmtime, so that they notify the memory.atomic.wait32 waiters and are notified by memory.atomic.notify.
The memories are .NET arrays, which the ArrayBuffer objects of JavaScript share. The WebAssembly code is interrupted when the script engine interrupts the scripts (e.g. its timeout).
- Inheritance
WebAssemblyRuntimeWasmtimeRuntime- Implements
Constructors
| Name | Description |
|---|---|
| WasmtimeRuntime(WasmtimeRuntimeOptions?) | Creates a runtime. |
WasmtimeRuntime(WasmtimeRuntimeOptions?)
WasmtimeRuntime.csCreates a runtime.
public WasmtimeRuntime(WasmtimeRuntimeOptions? options = null)Parameters
optionsWasmtimeRuntimeOptions?- The options, or null for the default options.
Properties
| Name | Description |
|---|---|
| Options | Gets the options of the runtime. |
Options
WasmtimeRuntime.csMethods
| Name | Description |
|---|---|
| Dispose() | Releases the engine. The stores and the modules must not be used afterwards. |
Dispose()
WasmtimeRuntime.csReleases the engine. The stores and the modules must not be used afterwards.
public void Dispose()