WasmWebAssemblyRuntime Class
A WebAssemblyRuntime based on Meziantou.Framework.WasmEngine (a WebAssembly engine written in .NET): set it in BrowsingContextOptions.WebAssemblyRuntime to define the WebAssembly namespace in the realms of the scripts.
public sealed class WasmWebAssemblyRuntime : 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 the engine, 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). The runtime emits the activities and the metrics of Meziantou.Framework.WasmEngine.
- Inheritance
WebAssemblyRuntimeWasmWebAssemblyRuntime- Implements
Constructors
| Name | Description |
|---|---|
| WasmWebAssemblyRuntime(WasmRuntime) | Creates a runtime that uses a WasmRuntime, which it does not dispose. |
| WasmWebAssemblyRuntime(WasmRuntimeOptions?) | Creates a runtime, and the WasmRuntime it uses. |
WasmWebAssemblyRuntime overloads
WasmWebAssemblyRuntime(WasmRuntime)
WasmWebAssemblyRuntime.csCreates a runtime that uses a WasmRuntime, which it does not dispose.
public WasmWebAssemblyRuntime(WasmRuntime runtime)Parameters
runtimeWasmRuntime- The runtime of the engine.
WasmWebAssemblyRuntime(WasmRuntimeOptions?)
WasmWebAssemblyRuntime.csCreates a runtime, and the WasmRuntime it uses.
public WasmWebAssemblyRuntime(WasmRuntimeOptions? options = null)Parameters
optionsWasmRuntimeOptions?- The options of the
WasmRuntime, or null for the default options.
Properties
| Name | Description |
|---|---|
| Runtime | Gets the runtime of the engine that compiles and runs the modules. |
Runtime
WasmWebAssemblyRuntime.csGets the runtime of the engine that compiles and runs the modules.
public WasmRuntime Runtime { get; }Property value
Methods
| Name | Description |
|---|---|
| Dispose() | Releases the WasmRuntime when the runtime created it. The stores and the modules must not be used afterwards. |
Dispose()
WasmWebAssemblyRuntime.csReleases the WasmRuntime when the runtime created it. The stores and the modules must not be used afterwards.
public void Dispose()