Files
Alok Pandey c5f555ef05 Fix WASM memory allocation failure (#4989) (#7887)
* 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
2026-06-03 20:32:24 +09:00
..