WasmExecutionPolicy

sealed interface WasmExecutionPolicy

Selects one complete WebAssembly execution strategy for an Instance.

The policy keeps the platform engine choice and its resource limit together, so embedders do not have to coordinate ExecutionBackend and WasmtimeExecutionConfig independently. Platform availability is still authoritative: host WebAssembly is available on wasmJs, iOS Wasmtime supports Pulley targets, and native Wasmtime targets are only available where the linked provider reports them.

Inheritors

Types

Link copied to clipboard
data class Automatic(val maxMemoryBytes: Long? = null, val memoryPolicy: WasmMemoryPolicy? = null) : WasmExecutionPolicy

Let the platform choose its normal engine and apply one atomic memory policy.

Link copied to clipboard
data class HostWebAssembly(val maxMemoryBytes: Long? = null, val memoryPolicy: WasmMemoryPolicy? = null) : WasmExecutionPolicy

Require the host platform WebAssembly engine, such as browser or Node WebAssembly.

Link copied to clipboard
data class Wasmtime(val config: WasmtimeExecutionConfig, val memoryPolicy: WasmMemoryPolicy? = null) : WasmExecutionPolicy

Require the linked Wasmtime provider with the supplied target and serialized-module policy.