On Fri Nov 11 14:40:08 2022 +0000, Francisco Casas wrote:
btw, I realized that in the `primary_expr:` rule, in the `VAR_IDENTIFIER` case, we are also forgetting to do
vkd3d_free($1);
in case you see that valgrind still reports lost memory after freeing `name`.
Yeah, I think it's safe to say there's a *lot* of memory leaks in the parser. Most of them on error paths, but I see some not on error paths too :-/
Given the way we have to allocate lots of small pieces of memory, and free most of them at exactly one point in time when the parser destroys itself, I wonder if it's worth using a custom pool, that frees everything at once. (There's probably a name for this pattern but I don't know it.)