[WIP] Improved memory handling (#56)

* Improved memory handling

* Fix memory accessibility

* Fix formatting
This commit is contained in:
Syrus Akbary
2018-12-15 10:30:53 -08:00
committed by Lachlan Sneff
parent 64eff86395
commit ff45aea0ea
4 changed files with 12 additions and 14 deletions

View File

@ -509,7 +509,7 @@ impl Instance {
let mem = &mut memories[init.memory_index.index()];
let end_of_init = offset + init.data.len();
if end_of_init > mem.current_size() {
let grow_pages = (end_of_init / LinearMemory::WASM_PAGE_SIZE) + 1;
let grow_pages = (end_of_init / LinearMemory::PAGE_SIZE as usize) + 1;
mem.grow(grow_pages as u32)
.expect("failed to grow memory for data initializers");
}