aboutsummaryrefslogtreecommitdiff
path: root/stdio-common/scanf15.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2023-08-11 11:18:17 +0200
committerFlorian Weimer <fweimer@redhat.com>2023-08-22 16:31:29 +0200
commit98c293c61f770b6b7a22f89a6ea81b711ecb1952 (patch)
treeefd293d5be8def3f81e5df93011265aeb4f9370e /stdio-common/scanf15.c
parent7ac405a74c6069b0627dc2d8449a82a621f8ff06 (diff)
downloadglibc-98c293c61f770b6b7a22f89a6ea81b711ecb1952.tar
glibc-98c293c61f770b6b7a22f89a6ea81b711ecb1952.tar.gz
glibc-98c293c61f770b6b7a22f89a6ea81b711ecb1952.tar.bz2
glibc-98c293c61f770b6b7a22f89a6ea81b711ecb1952.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)
Diffstat (limited to 'stdio-common/scanf15.c')
0 files changed, 0 insertions, 0 deletions