summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2023-08-11 11:18:17 +0200
committerAndreas K. Hüttel <dilfridge@gentoo.org>2023-08-23 13:36:49 +0200
commit12249ca1b007c9d86a744af9b57bcc7e31d5a7b4 (patch)
treebdb21e021fc52e3c3302b5a2a6f14e2938cac026 /math/w_asinl_compat.c
parenti686: Fix build with --disable-multiarch (diff)
downloadglibc-12249ca1b007c9d86a744af9b57bcc7e31d5a7b4.tar.gz
glibc-12249ca1b007c9d86a744af9b57bcc7e31d5a7b4.tar.bz2
glibc-12249ca1b007c9d86a744af9b57bcc7e31d5a7b4.zip
malloc: Enable merging of remainders in memalign (bug 30723)
Previously, calling _int_free from _int_memalign could put remainders into the tcache or into fastbins, where they are invisible to the low-level allocator. This results in missed merge opportunities because once these freed chunks become available to the low-level allocator, further memalign allocations (even of the same size are) likely obstructing merges. Furthermore, during forwards merging in _int_memalign, do not completely give up when the remainder is too small to serve as a chunk on its own. We can still give it back if it can be merged with the following unused chunk. This makes it more likely that memalign calls in a loop achieve a compact memory layout, independently of initial heap layout. Drop some useless (unsigned long) casts along the way, and tweak the style to more closely match GNU on changed lines. Reviewed-by: DJ Delorie <dj@redhat.com> (cherry picked from commit 542b1105852568c3ebc712225ae78b8c8ba31a78) (cherry picked from commit 98c293c61f770b6b7a22f89a6ea81b711ecb1952)
Diffstat (limited to 'math/w_asinl_compat.c')
0 files changed, 0 insertions, 0 deletions