Merge pull request #3 from kobigurk/master Make memory grow on overflowing allocation
Jordi Baylina jordi@baylina.cat
Wed, 15 May 2019 10:11:11 +0200
1 files changed,
4 insertions(+),
0 deletions(-)
jump to
M
src/groth16.js
→
src/groth16.js
@@ -68,6 +68,10 @@ function alloc(length) {
while (i32[0] & 3) i32[0]++; // Return always aligned pointers const res = i32[0]; i32[0] += length; + while (i32[0] > memory.buffer.byteLength) { + memory.grow(100); + } + i32 = new Uint32Array(memory.buffer); return res; }