From 021a2b85fb9264d9cb4a21c039682d1f0fddbd1c Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Mon, 15 Oct 2018 16:07:24 -0700 Subject: Support 4GB Memories (#1702) This fixes asm2wasm parsing of the max to allow 4GB, and also changes the internal Memory::kMaxValue values to reflect that. We used to use kMaxValue to also represent "no limit", so I split that out into kUnlimitedValue. --- src/wasm-js.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/wasm-js.cpp') diff --git a/src/wasm-js.cpp b/src/wasm-js.cpp index a777295d7..381487cd0 100644 --- a/src/wasm-js.cpp +++ b/src/wasm-js.cpp @@ -78,7 +78,7 @@ extern "C" void EMSCRIPTEN_KEEPALIVE load_asm2wasm(char *input) { exit(EXIT_FAILURE); } module->memory.initial = Address(providedMemory / Memory::kPageSize); - module->memory.max = pre.memoryGrowth ? Address(Memory::kMaxSize) : module->memory.initial; + module->memory.max = pre.memoryGrowth ? Address(Memory::kUnlimitedSize) : module->memory.initial; if (wasmJSDebug) std::cerr << "wasming...\n"; asm2wasm = new Asm2WasmBuilder(*module, pre, debug, TrapMode::JS, PassOptions(), true /* runJSFFIPass */, false /* TODO: support optimizing? */, false /* TODO: support asm2wasm-i64? */); @@ -94,7 +94,7 @@ void finalizeModule() { exit(EXIT_FAILURE); } module->memory.initial = Address(providedMemory / Memory::kPageSize); - module->memory.max = module->getExportOrNull(GROW_WASM_MEMORY) ? Address(Memory::kMaxSize) : module->memory.initial; + module->memory.max = module->getExportOrNull(GROW_WASM_MEMORY) ? Address(Memory::kUnlimitedSize) : module->memory.initial; // global mapping is done in js in post.js } -- cgit v1.2.3