mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Free iv index table
IV index tables weren't being freed. This program would leak memory: ```ruby loop do k = Class.new do def initialize @a = 1 @b = 1 @c = 1 @d = 1 @e = 1 @f = 1 @g = 1 end end k.new end ``` This commit fixes the leak.
This commit is contained in:
parent
607aa11711
commit
417c648f08
Notes:
git
2021-03-24 05:10:52 +09:00
1 changed files with 1 additions and 0 deletions
1
gc.c
1
gc.c
|
@ -2628,6 +2628,7 @@ static void
|
||||||
iv_index_tbl_free(struct st_table *tbl)
|
iv_index_tbl_free(struct st_table *tbl)
|
||||||
{
|
{
|
||||||
st_foreach(tbl, free_iv_index_tbl_free_i, 0);
|
st_foreach(tbl, free_iv_index_tbl_free_i, 0);
|
||||||
|
st_free_table(tbl);
|
||||||
}
|
}
|
||||||
|
|
||||||
// alive: if false, target pointers can be freed already.
|
// alive: if false, target pointers can be freed already.
|
||||||
|
|
Loading…
Add table
Reference in a new issue