[updated patch] malloc per-thread cache ready for review

Florian Weimer fweimer@redhat.com
Mon May 8 08:11:00 GMT 2017


On 03/10/2017 06:02 AM, DJ Delorie wrote:

> +typedef struct TCacheEntry {
> +  struct TCacheEntry *next;
> +} TCacheEntry;
> +
> +/* There is one of these for each thread, which contains the
> +   per-thread cache (hence "TCache").  Keeping overall size low is
> +   mildly important.  Note that COUNTS and ENTRIES are redundant, this
> +   is for performance reasons.  */
> +typedef struct TCache {
> +  char counts[TCACHE_IDX];
> +  TCacheEntry *entries[TCACHE_IDX];
> +} TCache;

These type names remind me of Turbo Vision.  I don't think we use the 
CamelCase convention in glibc. :)

I would like to see some discussion of the per-thread overhead the 
thread cache introduces, maybe along the documentation of the tunables, 
both the static overhead (due to new per-thread state) and some bounds 
on the additional per-thread allocation retention.

Thanks,
Florian



More information about the Libc-alpha mailing list