Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Melbourne leaks memory when raising a SyntaxError #249
At present, when melbourne raise a syntax error, it has partially constructed a NODE* tree. The memory for this tree is managed by pt_allocate, which uses a simple memory pool mechanism to free the entire tree at the same time. This happens fine.
The problem is that the tree contains bstring's which need to have bdestroy() run on them or they leak memory. At present, bdestroy() is run when we run the visitors on the tree. But if a syntax error is cut, the tree is not processed and the bstring's are leak.
Possible solutions are to not use bstring at all within NODE* and instead build a simple string library that uses pt_allocate for allocations.