Closed Varriount closed 2 years ago
Yeah sorry for that, the tracing implementation is not really optimized for size or performance, as it is not something one would typically run into. I do prefer keeping it as-is because of the simple implementation.
Closing the ticket now as part of spring cleaning, feel free to reopen if needed!
When
npegTrace
is enabled, a closure is allocated for each state generated by NPeg. This is due to the fact thatdoTrace
is defined insidegenTraceCode
. For large grammars, this can cause programs to suddenly crash, due to the program attempting to allocate stack memory for all the closure pointers.