mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2024-12-25 19:11:45 +03:00
Ensure our JS heap is a dense array
Turns out `heap.fill(undefined)` is required to ensure it's a dense array, otherwise we'll accidentally be a sparse array and much slower than necessary!
This commit is contained in:
parent
29531c0abf
commit
a83c3af4bf
@ -907,6 +907,7 @@ impl<'a> Context<'a> {
|
||||
return;
|
||||
}
|
||||
self.global(&format!("const heap = new Array({});", INITIAL_HEAP_OFFSET));
|
||||
self.global("heap.fill(undefined);");
|
||||
self.global(&format!("heap.push({});", INITIAL_HEAP_VALUES.join(", ")));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user