Fix memory leak of rb_ast_t in parser
ast_alloc uses TypedData_Make_Struct, which allocates a rb_ast_t. But it is overwritten when we set the DATA_PTR so the original memory is leaked.
For example:
10.times do 100_000.times do eval("") end puts `ps -o rss= -p #{$$}` end
Before:
17328 20752 23664 28400 30656 34224 37424 40784 43328 46656
After:
14320 14320 14320 14320 14320 14320 14320 14336 14336 14336
Fix memory leak of rb_ast_t in parser
ast_alloc uses TypedData_Make_Struct, which allocates a rb_ast_t. But it
is overwritten when we set the DATA_PTR so the original memory is leaked.
For example:
Before:
After: