Eset: Parameterize last globals accesses.

I.e. opt_retain and maps_coalesce.
This commit is contained in:
David Goldblatt 2020-03-14 10:05:12 -07:00 committed by David Goldblatt
parent 7bb6e2dc0d
commit f730577277
3 changed files with 14 additions and 12 deletions

View file

@ -398,6 +398,11 @@ extent_recycle_extract(tsdn_t *tsdn, pa_shard_t *shard, ehooks_t *ehooks,
emap_unlock_edata(tsdn, &emap_global, unlock_edata);
}
} else {
/*
* If split and merge are not allowed (Windows w/o retain), try
* exact fit only.
*/
bool exact_only = (!maps_coalesce && !opt_retain);
/*
* A large extent might be broken up from its original size to
* some small size to satisfy a small request. When that small
@ -409,7 +414,8 @@ extent_recycle_extract(tsdn_t *tsdn, pa_shard_t *shard, ehooks_t *ehooks,
*/
unsigned lg_max_fit = ecache->delay_coalesce
? (unsigned)opt_lg_extent_max_active_fit : SC_PTR_BITS;
edata = eset_fit(&ecache->eset, size, alignment, lg_max_fit);
edata = eset_fit(&ecache->eset, size, alignment, exact_only,
lg_max_fit);
}
if (edata == NULL) {
malloc_mutex_unlock(tsdn, &ecache->mtx);