From 5f81f58b2696db3c1c3fc44a2c83dbff85747100 Mon Sep 17 00:00:00 2001 From: John Hawthorn Date: Wed, 6 Dec 2023 19:17:40 -0800 Subject: [PATCH] Use xfree in hash_st_free st.c redefines malloc and free to be ruby_xmalloc and ruby_xfree, so when this was copied into hash.c it ended up mismatching an xmalloc with a regular free, which ended up inflating oldmalloc_increase_bytes when hashes were freed by minor GC. --- hash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hash.c b/hash.c index d025b1c30a..1545af87b2 100644 --- a/hash.c +++ b/hash.c @@ -1177,8 +1177,8 @@ hash_st_free(VALUE hash) st_table *tab = RHASH_ST_TABLE(hash); - free(tab->bins); - free(tab->entries); + xfree(tab->bins); + xfree(tab->entries); } static void