diff options
author | Kenichi Kamiya <[email protected]> | 2021-03-28 14:09:52 +0900 |
---|---|---|
committer | GitHub <[email protected]> | 2021-03-28 14:09:52 +0900 |
commit | 522d4cd32f7727886f4fcbc28ed29c08d361ee20 (patch) | |
tree | e631fef0746bf848bd95f05610181f19cc05679d /hash.c | |
parent | 9af57eeed61ad53c0a2a92a93a6a6e40704cd6ae (diff) |
Force recycle intermediate collection in Hash#transform_keys! [Bug #17735]
* Force recycle intermediate hash
* Force recycle intermediate array too
https://github.com/ruby/ruby/pull/4329#issuecomment-808840718
Notes
Notes:
Merged-By: nobu <[email protected]>
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -3294,7 +3294,9 @@ rb_hash_transform_keys_bang(int argc, VALUE *argv, VALUE hash) rb_hash_aset(new_keys, new_key, Qnil); } rb_ary_clear(pairs); + rb_gc_force_recycle(pairs); rb_hash_clear(new_keys); + rb_gc_force_recycle(new_keys); } return hash; } |