Prepare tcache for size to grow by PAGE over GROUP*PAGE

To prepare for the upcoming changes where size class grows by PAGE when
larger than NGROUP * PAGE, disable the tcache when it is larger than 2 *
NGROUP * PAGE. The threshold for tcache is set higher to prevent perf
regression as much as possible while usizes between NGROUP * PAGE and 2 *
NGROUP * PAGE happen to grow by PAGE.
This commit is contained in:
Guangli Dai 2025-01-31 14:07:05 -08:00
parent eac4163a95
commit 205ba7b223
3 changed files with 26 additions and 1 deletions

View file

@ -2201,6 +2201,9 @@ static bool
malloc_init_hard(void) {
tsd_t *tsd;
if (config_limit_usize_gap) {
assert(TCACHE_MAXCLASS_LIMIT <= USIZE_GROW_SLOW_THRESHOLD);
}
#if defined(_WIN32) && _WIN32_WINNT < 0x0600
_init_init_lock();
#endif