diff options
author | Florian Weimer <fweimer@redhat.com> | 2023-08-11 11:18:17 +0200 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2023-08-11 11:18:17 +0200 |
commit | 542b1105852568c3ebc712225ae78b8c8ba31a78 (patch) | |
tree | fd7101ea415b0f92af6e87e285bb2418846c734e /sysdeps | |
parent | 039ff51ac7e02db1cfc0c23e38ac7bfbb00221d1 (diff) | |
download | glibc-542b1105852568c3ebc712225ae78b8c8ba31a78.zip glibc-542b1105852568c3ebc712225ae78b8c8ba31a78.tar.gz glibc-542b1105852568c3ebc712225ae78b8c8ba31a78.tar.bz2 |
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>
Diffstat (limited to 'sysdeps')
0 files changed, 0 insertions, 0 deletions