1
0
mirror of https://github.com/fluencelabs/wasm-bindgen synced 2025-03-31 17:31:06 +00:00

Merge pull request from alexcrichton/dense

Ensure our JS heap is a dense array
This commit is contained in:
Alex Crichton 2018-11-30 16:00:52 -06:00 committed by GitHub
commit 0e1494f2a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -907,6 +907,7 @@ impl<'a> Context<'a> {
return; return;
} }
self.global(&format!("const heap = new Array({});", INITIAL_HEAP_OFFSET)); self.global(&format!("const heap = new Array({});", INITIAL_HEAP_OFFSET));
self.global("heap.fill(undefined);");
self.global(&format!("heap.push({});", INITIAL_HEAP_VALUES.join(", "))); self.global(&format!("heap.push({});", INITIAL_HEAP_VALUES.join(", ")));
} }