Fix arena_dalloc() performance regression.

Take into account large_pad when computing whether to pass the
deallocation request to tcache_dalloc_large(), so that the largest
cacheable size makes it back to tcache.  This regression was introduced
by 8a03cf039c (Implement cache index
randomization for large allocations.).
This commit is contained in:
Jason Evans 2015-05-19 17:44:45 -07:00
parent 5154175cf1
commit 6591ff09d8

View File

@ -1181,7 +1181,8 @@ arena_dalloc(tsd_t *tsd, void *ptr, tcache_t *tcache)
assert(config_cache_oblivious || ((uintptr_t)ptr &
PAGE_MASK) == 0);
if (likely(tcache != NULL) && size <= tcache_maxclass) {
if (likely(tcache != NULL) && size - large_pad <=
tcache_maxclass) {
tcache_dalloc_large(tsd, tcache, ptr, size -
large_pad);
} else {