mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-06-01 17:54:16 +03:00
Eset: take opt_lg_max_active_fit as a parameter.
This breaks its dependence on the global.
This commit is contained in:
parent
883ab327cc
commit
7bb6e2dc0d
3 changed files with 31 additions and 14 deletions
14
src/extent.c
14
src/extent.c
|
|
@ -398,8 +398,18 @@ extent_recycle_extract(tsdn_t *tsdn, pa_shard_t *shard, ehooks_t *ehooks,
|
|||
emap_unlock_edata(tsdn, &emap_global, unlock_edata);
|
||||
}
|
||||
} else {
|
||||
edata = eset_fit(&ecache->eset, size, alignment,
|
||||
ecache->delay_coalesce);
|
||||
/*
|
||||
* A large extent might be broken up from its original size to
|
||||
* some small size to satisfy a small request. When that small
|
||||
* request is freed, though, it won't merge back with the larger
|
||||
* extent if delayed coalescing is on. The large extent can
|
||||
* then no longer satify a request for its original size. To
|
||||
* limit this effect, when delayed coalescing is enabled, we
|
||||
* put a cap on how big an extent we can split for a request.
|
||||
*/
|
||||
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);
|
||||
}
|
||||
if (edata == NULL) {
|
||||
malloc_mutex_unlock(tsdn, &ecache->mtx);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue