Browse Source

Make memory grow on overflowing allocation

master
Kobi Gurkan 5 years ago
parent
commit
30a4b3d7fb
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      src/groth16.js

+ 4
- 0
src/groth16.js

@ -68,6 +68,10 @@ function thread(self) {
while (i32[0] & 3) i32[0]++; // Return always aligned pointers while (i32[0] & 3) i32[0]++; // Return always aligned pointers
const res = i32[0]; const res = i32[0];
i32[0] += length; i32[0] += length;
while (i32[0] > memory.buffer.byteLength) {
memory.grow(100);
}
i32 = new Uint32Array(memory.buffer);
return res; return res;
} }

Loading…
Cancel
Save