diff options
author | Peter Zhu <peter@peterzhu.ca> | 2023-09-24 09:07:52 -0400 |
---|---|---|
committer | Peter Zhu <peter@peterzhu.ca> | 2023-09-24 09:07:52 -0400 |
commit | f43dac0df29c137ae966362f7faf26084468a0fb (patch) | |
tree | 16a39f84979a86a57727dbf829760a3fff14c8ee /hash.c | |
parent | 36cdf163dfbcac5b0e7fedbd55c817b5d5c971fb (diff) |
Add rb_hash_free for the GC to use
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -1178,6 +1178,14 @@ hash_st_free_and_clear_table(VALUE hash) RHASH_ST_CLEAR(hash); } +void +rb_hash_free(VALUE hash) +{ + if (RHASH_ST_TABLE_P(hash)) { + hash_st_free(hash); + } +} + typedef int st_foreach_func(st_data_t, st_data_t, st_data_t); struct foreach_safe_arg { |