Skip to main content

Module engine

Module engine 

Source

Structs§

OutOfTime
The failure of a run past its time limit

Constants§

DEFAULT_MEMORY_CAP_MB
The size any one memory or GC heap of a run may grow to: a runaway program stops with an error instead of swapping the machine to death (a 154 GB process took the Mac down, 2026-10-09)
EPOCH_TICK
How often a ticking engine’s epoch advances: a run passes its time limit by at most about this much
MEMORY_CAP_VARIABLE
Environment variable that overrides DEFAULT_MEMORY_CAP_MB

Functions§

cap_memory
Every growth of the store’s linear memories and its GC heap (wasmtime grows the GC heap’s memory through the same limiter) past memory_cap_bytes fails the run with an error naming the cap
checked_store
limited_store that also runs checkpoint at every epoch tick (a task’s stop and pause), failing the run when it fails
deterministic_config
Engine settings every warp run shares: GC and typed function references. NaNs are canonicalized where they are observed (floats::canonical_nan, P119), not after every float operation, which doubled the cost of float loops. Machine code compiled with these settings (warp compile --aot, warp build) loads into any engine made from them, with or without a compiler.
give_main_stack_to_wasm
Called on the main thread before any engine is made: wasm runs on the main thread and may use its stack but HOST_STACK_BYTES, a million frames instead of about 15000 (card deep-recursion). Other threads (tests, tasks) keep the default, which fits their smaller stacks.
limited_store
A store whose run stops: with fuel steps on an engine that meters fuel, else after time of computing in one turn (each call from the host into the program: main, a frame, an event handler, so a game or a server runs for as long as it likes); its memories and GC heap capped (cap_memory)
memory_cap_bytes
The cap in bytes: WARP_MEMORY_CAP_MB if it is set to a number, else the default
metered_config
deterministic_config with epoch interruption, where a run checks its time limit (and a task whether to stop), and with fuel metering when fuel: the settings of warp’s engines. Epoch checks cost a few percent, fuel about four times on calls, so only runs that ask for it count steps (decision fuel-metering).
profiled_store
limited_store sampling where module’s run spends its time when WARP_PROFILE names a file (profile.rs)
ticking
engine with a thread advancing its epoch every EPOCH_TICK for the rest of the process: its stores check their time limit at each tick. For engines that live as long as the process (shared or standalone).
wasm_stack_bytes
The wasm call stack engines get, 0 for wasmtime’s default: a thread running wasm of such an engine needs a stack this large besides its own frames (the self-hosted stage workers, src/compiler/self_hosted.rs)