[all-commits] [llvm/llvm-project] cb4f94: [lld][WebAssembly] Add `--no-growable-memory` (#82...

SingleAccretion via All-commits all-commits at lists.llvm.org
Sun Feb 25 08:43:23 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cb4f94db83d9c4373b485493ef079e318f63bf13
      https://github.com/llvm/llvm-project/commit/cb4f94db83d9c4373b485493ef079e318f63bf13
  Author: SingleAccretion <62474226+SingleAccretion at users.noreply.github.com>
  Date:   2024-02-25 (Sun, 25 Feb 2024)

  Changed paths:
    M lld/docs/WebAssembly.rst
    M lld/test/wasm/data-layout.s
    M lld/wasm/Config.h
    M lld/wasm/Driver.cpp
    M lld/wasm/Options.td
    M lld/wasm/Writer.cpp

  Log Message:
  -----------
  [lld][WebAssembly] Add `--no-growable-memory` (#82890)

We recently added `--initial-heap` - an option that allows one to up the
initial memory size without the burden of having to know exactly how
much is needed.

However, in the process of implementing support for this in Emscripten
(https://github.com/emscripten-core/emscripten/pull/21071), we have
realized that `--initial-heap` cannot support the use-case of
non-growable memories by itself, since with it we don't know what to set
`--max-memory` to.

We have thus agreed to move the above work forward by introducing
another option to the linker (see
https://github.com/emscripten-core/emscripten/pull/21071#discussion_r1491755616),
one that would allow users to explicitly specify they want a
non-growable memory.

This change does this by introducing `--no-growable-memory`: an option
that is mutally exclusive with `--max-memory` (for simplicity - we can
also decide that it should override or be overridable by `--max-memory`.
In Emscripten a similar mix of options results in `--no-growable-memory`
taking precedence). The option specifies that the maximum memory size
should be set to the initial memory size, effectively disallowing memory
growth.

Closes #81932.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list