<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/81932>81932</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[wasm-ld] How to specify a non-growable memory without `--initial-memory` and `--max-memory`
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
sbc100
</td>
</tr>
</table>
<pre>
Until recently the way to specify a non-growable memory was to specify both `--initial-memory` and `--max-memory` and set them to the same value. This is what emscripten currently does by default unless you opt into `-sALLOW_MEMORY_GROWTH`.
However, we recently added a new `--initial-heap` flag which allows the user to set and initial heap size and have the linker then derive the initial memory size based on the sum of stack size + heap size + static data size. See #75594.
When attempting to start using this flag in emscripten we discovered that there is no way to use the `--initial-heap` flag and still get a non-growable memory. See https://github.com/emscripten-core/emscripten/pull/21071/files#r1491731562.
It seems that we need some kind of flag like the existing `--growable-table` flag. It would be nice to add `--growable-memory` except that would mean changing the default to non-growable, which is perhaps too much of a breaking change. @sunfishcode WDYT?
Instead perhaps we can add `--no-growable-memory`?
Perhaps the existing `--growable-table` flag could also take a `no-` prefix so that they were symmetrical?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVE2P2zYQ_TX0ZWBDpmR7dfAh6dZNgARbpFsscgpG4thiTZECZ7Ra99cXpL0fDtIi9UEG54vvvRkOMtuDJ9qq1Xu1up3hKF2IW27aZVHMmmBO2z-9WAeRWvLiTiAdwYQnkAA8UGv3J0Dwwc8PMUzYOIKe-hBPMCG_DWqCdKDWxXxuvRWLbn6OU-sC0Juzq8en78xMkq7sU6l0NWNP8IhupAUA3HeWwTJMHQpQz220g5CHdozxDNcEYmhOYGiPoxMYvSNmOIURwiBgvYR8Nb_79Onu4dvnXz_fffn67bcvdw_3H9S6WKjiVhXvzt8PYaJHikr_AhO9KoLGkEki0HRNsCMcEo-9wwNMnW07QOfCxJn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