From 1b45938aadd6e03e9210d88436be9c393623fb42 Mon Sep 17 00:00:00 2001 From: Derek Schuff Date: Fri, 4 Mar 2016 17:09:47 -0800 Subject: Make initial and max memory sizes be in pages instead of bytes The AST and everything that uses it treats the values as pages. Javascript continues to use bytes. This matches v8 and sexpr-wasm, and the consensus from live discussion and PR209 in the spec. --- src/binaryen-shell.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/binaryen-shell.cpp') diff --git a/src/binaryen-shell.cpp b/src/binaryen-shell.cpp index 61cab723c..bfed8277e 100644 --- a/src/binaryen-shell.cpp +++ b/src/binaryen-shell.cpp @@ -111,10 +111,10 @@ struct ShellExternalInterface : ModuleInstance::ExternalInterface { ShellExternalInterface() : memory() {} void init(Module& wasm) override { - memory.resize(wasm.memory.initial); + memory.resize(wasm.memory.initial * wasm::Memory::kPageSize); // apply memory segments for (auto segment : wasm.memory.segments) { - assert(segment.offset + segment.size <= wasm.memory.initial); + assert(segment.offset + segment.size <= wasm.memory.initial * wasm::Memory::kPageSize); for (size_t i = 0; i != segment.size; ++i) { memory.set(segment.offset + i, segment.data[i]); } -- cgit v1.2.3