]> git.ipfire.org Git - thirdparty/glibc.git/commit
malloc: Count tcache entries downwards
authorWilco Dijkstra <wilco.dijkstra@arm.com>
Wed, 9 Apr 2025 17:41:22 +0000 (17:41 +0000)
committerWilco Dijkstra <wilco.dijkstra@arm.com>
Tue, 3 Jun 2025 17:16:39 +0000 (17:16 +0000)
commit7e10e30e64aa2cc8ba50f2f83cb7cc2cdad134ad
treec5e85777cc43b4d508ea08694b6bb87c0567f621
parent404526ee2e58f3c075253943ddc9988f4bd6b80c
malloc: Count tcache entries downwards

Currently tcache requires 2 global variable accesses to determine
whether a block can be added to the tcache.  Change the counts array
to 'num_slots' to indicate the number of entries that could be added.
If 'num_slots' reaches zero, no more blocks can be added.  If the entries
pointer is not NULL, at least one block is available for allocation.

Now each tcache bin can support a different maximum number of entries,
and they can be individually switched on or off (a zero initialized
num_slots+entry means the tcache bin is not available for free or malloc).

Reviewed-by: DJ Delorie <dj@redhat.com>
malloc/malloc.c