[PATCH v12 1/2] malloc: add tcache support for large chunk caching

Wilco Dijkstra Wilco.Dijkstra@arm.com
Tue Jul 8 15:57:14 GMT 2025


Hi Cupertino,

It looks like you didn't address my comment here (from v9):

> +# define TCACHE_SMALL_BINS             64
> +# define TCACHE_LARGE_BINS             12 /* Up to 4M chunks */
> +# define TCACHE_MAX_BINS       (TCACHE_SMALL_BINS + TCACHE_LARGE_BINS)
> +# define MAX_TCACHE_SMALL_SIZE tidx2usize (TCACHE_MAX_BINS-1)
>
> Small bins surely???
>

So the committed version uses tcache up to around 1216 bytes instead of 1036, which
would mean the large bins are being used accidentally. This doesn't seem like it
should cause bugs in that there is always another check with TCACHE_SMALL_BINS for
small tcache, however there could be issues in large tcache code.

Not sure how it could explain the hang Florian was seeing though, especially since it
apparently still happens with tcache turned off?

Cheers,
Wilco


More information about the Libc-alpha mailing list