While valgrinding unit tests and plugging leaks, I found that /core/grammar/end leaks even if I add h_cfgrammar_free(g) to test_end(). The cause is the calls to h_new() (rather than in the grammar's arena) in if (h_hashset_empty(g->nts)) branch of h_cfgrammar_(). Unfortunately, these cannot simply be changed over to h_arena_malloc() calls because the LL(k) backend frees the grammar once it finishes compiling the parser, but apparently keeps some of these pointers around and uses them during parsing. Further investigation proceeding.
While valgrinding unit tests and plugging leaks, I found that
/core/grammar/endleaks even if I addh_cfgrammar_free(g)totest_end(). The cause is the calls toh_new()(rather than in the grammar's arena) inif (h_hashset_empty(g->nts))branch ofh_cfgrammar_(). Unfortunately, these cannot simply be changed over toh_arena_malloc()calls because the LL(k) backend frees the grammar once it finishes compiling the parser, but apparently keeps some of these pointers around and uses them during parsing. Further investigation proceeding.