mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 18:59:04 +08:00
* Fix WASM memory allocation failure (#4989) This commit addresses the unbounded memory allocation issue on WASM targets that caused minimal programs (like = 1) to fail with ~79MB allocation errors in constrained runtimes like wasmi. The fixes include: 1. Capping the max memory limit at 64MB and restricting stack size to 1MB via linker flags in .cargo/config.toml. 2. Reducing the minimum chunk size of the DataStack from 16KB to 4KB on WASM targets to shrink the initial memory footprint. 3. Adding a wasm-release profile in the root Cargo.toml optimized for size with opt-level = s, LTO enabled, and symbols stripped. * Trigger CI rerun * Address review feedback: add comments, use cfg! for MIN_CHUNK_SIZE * Remove duplicate MIN_CHUNK_SIZE definition * Fix duplicate MIN_CHUNK_SIZE and format for prek lint * Update CI to use wasm-release profile for WASM tests * Remove leftover conflict markers * Clean remaining conflict markers in CI workflow * Clean remaining conflict markers in CI workflow * Trigger CI to pick up new required check * Remove --max-memory flag, keep stack limit only