guybedford / es-module-lexer

Low-overhead lexer dedicated to ES module parsing for fast analysis
MIT License
917 stars 48 forks source link

fix: fixed allocation calculation #113

Closed guybedford closed 2 years ago

guybedford commented 2 years ago

A further asm.js memory allocation fix - the initial stack allocation should be constant based on the allocation bound being chosen, and not at all depending on the source size as the memory will be shared for other sources for efficiency. Previously, parsing a small string followed by a long string would underallocate the initial buffer and then overflow for the next parser operation!

This should finally be stability on these issues for now.