pub struct WasmMemory {
pub index: u32,
pub initial_pages: u32,
pub max_pages: Option<u32>,
pub shared: bool,
pub memory64: bool,
pub page_size_log2: Option<u32>,
}Expand description
WASM linear memory specification
Fields§
§index: u32Memory index
initial_pages: u32Initial size in pages (64KB each)
max_pages: Option<u32>Maximum size in pages (if specified)
Whether memory is shared (requires threads proposal)
memory64: bool#1209: whether this memory is 64-bit-INDEXED (the memory64 proposal,
(memory i64 ...)) rather than the default 32-bit index type. No
codegen path in this crate handles an i64 memory index — data-segment
offsets are decoded i32.const-only (silently DROPPING an
i64.const-offset segment) and every address-materialization path
assumes a 32-bit address, so a memory64 module compiled today produces
EXECUTABLE, WRONG code rather than failing to compile. This flag is
consumed by refuse_memory64_module in synth-cli to turn that into a
loud decline at decode time, the #1046 pattern.
page_size_log2: Option<u32>#1315: the log2 of this memory’s DECLARED page size (the
custom-page-sizes proposal, (memory 1 1 (pagesize N))), or None for
the default 64 KiB page. wasmparser decodes it; nothing in this
workspace read it, so a memory declared one byte long was reported and
reserved as 65536 — and __synth_mem_size_N, which the embedder
programs one MPU region from (#1145), inherited the over-grant by the
page-size ratio. Consumed by refuse_custom_page_size in synth-cli,
the refuse_memory64_module (#1209) pattern: decode the declaration,
then decline loudly rather than silently ignore it.