4 Commits
Author SHA1 Message Date
Alok Pandey 5f789c6146 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
Jeong, YunWon aa0eb4bedf rustpython-common wasm_js feature (#6116) 2025-09-17 09:11:13 +09:00
Jeong YunWon 18b7315c9a Fix windows stack size again 2021-10-02 14:09:31 +09:00
Jeong YunWon 5a06c80237 increase stack size for windows 2021-09-19 23:11:33 +09:00