{{ message }}
Commit c5f555e
authored
* 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
1 parent 376c4f1 commit c5f555e
4 files changed
Lines changed: 31 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
779 | 779 | | |
780 | 780 | | |
781 | 781 | | |
782 | | - | |
| 782 | + | |
783 | 783 | | |
784 | | - | |
| 784 | + | |
785 | 785 | | |
786 | | - | |
| 786 | + | |
787 | 787 | | |
788 | 788 | | |
789 | 789 | | |
| |||
820 | 820 | | |
821 | 821 | | |
822 | 822 | | |
| 823 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
120 | 128 | | |
121 | 129 | | |
122 | 130 | | |
| |||

0 commit comments