Skip to content

Commit

Permalink
[lld][WebAssembly] Limit size of shared 64-bit memories of 2^^34
Browse files Browse the repository at this point in the history
This is current limit in v8.  See
WebAssembly/memory64#33 how we might change
this in the future.

Differential Revision: https://reviews.llvm.org/D143783
  • Loading branch information
sbc100 committed Feb 13, 2023
1 parent 67d78e3 commit 9369b7d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lld/wasm/Writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,12 @@ void Writer::layoutMemory() {
WasmSym::heapBase->setVA(memoryPtr);
}

uint64_t maxMemorySetting = 1ULL << (config->is64.value_or(false) ? 48 : 32);
uint64_t maxMemorySetting = 1ULL << 32;
if (config->is64.value_or(false)) {
// TODO: Update once we decide on a reasonable limit here:
// https://github.com/WebAssembly/memory64/issues/33
maxMemorySetting = 1ULL << 34;
}

if (config->initialMemory != 0) {
if (config->initialMemory != alignTo(config->initialMemory, WasmPageSize))
Expand Down

0 comments on commit 9369b7d

Please sign in to comment.