]> git.ipfire.org Git - thirdparty/glibc.git/commit
malloc: send freed small chunks to smallbin
authork4lizen <k4lizen@proton.me>
Fri, 29 Nov 2024 13:25:29 +0000 (13:25 +0000)
committerWilco Dijkstra <wilco.dijkstra@arm.com>
Fri, 29 Nov 2024 13:27:13 +0000 (13:27 +0000)
commite2436d6f5aa47ce8da80c2ba0f59dfb9ffde08f3
treee461ce183d8028251d35c3ef24934fcf191b6142
parenta08d9a52f967531a77e1824c23b5368c6434a72d
malloc: send freed small chunks to smallbin

Large chunks get added to the unsorted bin since
sorting them takes time, for small chunks the
benefit of adding them to the unsorted bin is
non-existant, actually hurting performance.

Splitting and malloc_consolidate still add small
chunks to unsorted, but we can hint the compiler
that that is a relatively rare occurance.
Benchmarking shows this to be consistently good.

Authored-by: k4lizen <k4lizen@proton.me>
Signed-off-by: Aleksa Siriški <sir@tmina.org>
malloc/malloc.c