Cache bin: Make ncached_max a query on the info_t.

This commit is contained in:
David Goldblatt
2020-02-26 17:23:47 -08:00
committed by David Goldblatt
parent b66c0973cc
commit 74d36d78ef
5 changed files with 16 additions and 15 deletions

View File

@@ -1325,8 +1325,8 @@ arena_tcache_fill_small(tsdn_t *tsdn, arena_t *arena, tcache_t *tcache,
tcache->bin_refilled[binind] = true;
const bin_info_t *bin_info = &bin_infos[binind];
const unsigned nfill = cache_bin_ncached_max_get(binind,
tcache_bin_info) >> tcache->lg_fill_div[binind];
const unsigned nfill = cache_bin_info_ncached_max(
&tcache_bin_info[binind]) >> tcache->lg_fill_div[binind];
void **empty_position = cache_bin_empty_position_get(tbin, binind,
tcache_bin_info);

View File

@@ -75,8 +75,9 @@ tcache_event_hard(tsd_t *tsd, tcache_t *tcache) {
* Reduce fill count by 2X. Limit lg_fill_div such that
* the fill count is always at least 1.
*/
if ((cache_bin_ncached_max_get(binind, tcache_bin_info)
>> (tcache->lg_fill_div[binind] + 1)) >= 1) {
if ((cache_bin_info_ncached_max(
&tcache_bin_info[binind]) >>
(tcache->lg_fill_div[binind] + 1)) >= 1) {
tcache->lg_fill_div[binind]++;
}
} else {