Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Melbourne leaks memory when raising a SyntaxError #249

evanphx opened this Issue · 3 comments

3 participants


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.


Some of us in the office think you should leave this leak as punishment to people who have syntax errors in their code.


Don't you have to, like, rescue the SyntaxError for this to matter? Won't that happen only in irb?


Fixing post 1.0

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.