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, IDisposable

Remarks

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). The threads are not supported: the shared memories can only be created by JavaScript and cannot be imported by a module.

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
WebAssemblyRuntime WasmtimeRuntime
Implements

Constructors

NameDescription
WasmtimeRuntime(WasmtimeRuntimeOptions?)Creates a runtime.

WasmtimeRuntime(WasmtimeRuntimeOptions?)

WasmtimeRuntime.cs

Creates a runtime.

public WasmtimeRuntime(WasmtimeRuntimeOptions? options = null)

Parameters

options WasmtimeRuntimeOptions?
The options, or null for the default options.

Properties

NameDescription
OptionsGets the options of the runtime.

Gets the options of the runtime.

public WasmtimeRuntimeOptions Options { get; }

Methods

NameDescription
Dispose()Releases the engine. The stores and the modules must not be used afterwards.

Releases the engine. The stores and the modules must not be used afterwards.

public void Dispose()