//! The module's memory gets a declared maximum (waism R6), whatever RUSTFLAGS a build is //! given: a linker argument of the cdylib, for the wasm32 target only. /// 8,192 pages of 64 KiB: 512 MiB, an eighth of the profile's cap (ยง4.2). Parsing the /// bundle's JSON and decoding the reference codestream reaches 3,964 pages, which `host/` /// prints for each run. const MAX_MEMORY: u64 = 8_192 * 65_536; fn main() { if std::env::var("CARGO_CFG_TARGET_ARCH").as_deref() == Ok("wasm32") { println!("cargo:rustc-cdylib-link-arg=--max-memory={MAX_MEMORY}"); } println!("cargo:rerun-if-changed=build.rs"); }