Skip to main content

MAX_MODULE_BYTES

Constant MAX_MODULE_BYTES 

Source
pub const MAX_MODULE_BYTES: usize = _; // 67_108_864usize
Expand description

Hard upper bound on the byte length of a Wasm module the executor will accept for compilation. Modules above this size are rejected with ExecError::ModuleTooLarge before Module::from_binary runs — pathological code-section blow-ups can otherwise force Cranelift to burn arbitrary CPU on adversarial input. 64 MiB is comfortably above any legitimate ML kernel module we’ve seen (single-digit MiB is typical), while keeping the Cranelift worst case bounded.

This constant is the floor: embedders can tighten via EngineConfig::max_module_bytes.