Remove all memory leaks from vinumc#139
Conversation
There was a problem hiding this comment.
While the code works, I'm concerned about the usage of non-growable arena allocators specifically for handling user-generated strings, since they can be arbitrarily large and could easily compound past 10KiB for large documents or when we add support for importing multiple files.
Let's create an issue for that to not hang this PR in review |
ee66603 to
4c5380d
Compare
|
can you execute the sanize again? And also fix the commit mess I did in resolving the conflicts (only browser access here) |
We need to track the allocations made on the node `.childs` property to in the end free them. Do that by adding an arena to the AST. To force it's use, remove all functions that create standalone nodes and provide functions that creta nodes already linked with the AST.
58aad60 to
191f97c
Compare
We need to free the child ptrs and areanas in the end of compilation. To be able to that, add arenas to the evaluation context.
191f97c to
e36031f
Compare
To test this I configured the meson build folder with:
and ran the current tests. There is still one testing failing with this configuration, but it's the vutils allocator tests and it's only because of how the test are done.