summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2023-09-24 09:07:52 -0400
committerPeter Zhu <peter@peterzhu.ca>2023-09-24 09:07:52 -0400
commitf43dac0df29c137ae966362f7faf26084468a0fb (patch)
tree16a39f84979a86a57727dbf829760a3fff14c8ee /hash.c
parent36cdf163dfbcac5b0e7fedbd55c817b5d5c971fb (diff)
Add rb_hash_free for the GC to use
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/hash.c b/hash.c
index 8e0295c38e..8ac8664982 100644
--- a/hash.c
+++ b/hash.c
@@ -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 {