diff options
author | Peter Zhu <[email protected]> | 2023-09-29 13:45:25 -0400 |
---|---|---|
committer | Peter Zhu <[email protected]> | 2023-09-29 16:51:17 -0400 |
commit | 97564ddf2baa518e4bda5b7a59111943dc13f210 () | |
tree | 4fa31bdcfc90da6b535503e297ebed6ea4ec0ddc /node.c | |
parent | f88f5b59e8cd58f5a88013d192c8141ea0bb8499 (diff) |
Fix memory in the parser
Reproduction script: ``` require "ripper" 10.times do 20_000.times do Ripper.parse("") end puts `ps -o rss= -p #{$$}` end ``` Before: ``` 28032 34432 40704 47232 53632 60032 66432 72832 79232 85632 ``` After: ``` 21760 21760 21760 21760 21760 21760 21760 21760 21760 21760 ```
-rw-r--r-- | node.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -154,6 +154,10 @@ node_buffer_list_free(rb_ast_t *ast, node_buffer_list_t * nb) nbe = nbe->next; xfree(buf); } } struct rb_ast_local_table_link { |