Skip to content

Commit

Permalink
Use xfree in hash_st_free
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jhawthorn committed Dec 7, 2023
1 parent ca204a2 commit 5f81f58
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hash.c
Expand Up @@ -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
Expand Down

0 comments on commit 5f81f58

Please sign in to comment.