Skip to content

Commit 9369b7d

Browse files
committed
[lld][WebAssembly] Limit size of shared 64-bit memories of 2^^34
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
1 parent 67d78e3 commit 9369b7d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lld/wasm/Writer.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,12 @@ void Writer::layoutMemory() {
348348
WasmSym::heapBase->setVA(memoryPtr);
349349
}
350350

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

353358
if (config->initialMemory != 0) {
354359
if (config->initialMemory != alignTo(config->initialMemory, WasmPageSize))

0 commit comments

Comments
 (0)