summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
authorJean Boussier <jean.boussier@gmail.com>2026-01-31 18:41:55 +0100
committerJean Boussier <jean.boussier@gmail.com>2026-02-01 12:17:29 +0100
commitd328412da84cdd26adb9a162bbf745bd43f7ee75 (patch)
treec84a9b80291db3b8430ec6e0c6872df7683c17c3 /hash.c
parentdc6cdb1759166630f29c456279c84fee1c0351d5 (diff)
Use ruby_sized_xfree to free embedded Hash and Set
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/hash.c b/hash.c
index 83a55913fa..dbd8f76950 100644
--- a/hash.c
+++ b/hash.c
@@ -1173,17 +1173,13 @@ hash_st_free(VALUE hash)
{
HASH_ASSERT(RHASH_ST_TABLE_P(hash));
- st_table *tab = RHASH_ST_TABLE(hash);
-
- xfree(tab->bins);
- xfree(tab->entries);
+ rb_st_free_embedded_table(RHASH_ST_TABLE(hash));
}
static void
hash_st_free_and_clear_table(VALUE hash)
{
hash_st_free(hash);
-
RHASH_ST_CLEAR(hash);
}