1
0
Fork 0
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:
Aaron Patterson 2021-03-23 12:02:27 -07:00 committed by Aaron Patterson
parent 607aa11711
commit 417c648f08
Notes: git 2021-03-24 05:10:52 +09:00

1
gc.c
View file

@ -2628,6 +2628,7 @@ static void
iv_index_tbl_free(struct st_table *tbl)
{
st_foreach(tbl, free_iv_index_tbl_free_i, 0);
st_free_table(tbl);
}
// alive: if false, target pointers can be freed already.