Break extent_coalesce arena dependence
This commit is contained in:
parent
282a382326
commit
48ec5d4355
@ -1078,7 +1078,7 @@ extent_can_coalesce(ecache_t *ecache, const edata_t *inner,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
extent_coalesce(tsdn_t *tsdn, arena_t *arena, ehooks_t *ehooks,
|
extent_coalesce(tsdn_t *tsdn, edata_cache_t *edata_cache, ehooks_t *ehooks,
|
||||||
ecache_t *ecache, edata_t *inner, edata_t *outer, bool forward,
|
ecache_t *ecache, edata_t *inner, edata_t *outer, bool forward,
|
||||||
bool growing_retained) {
|
bool growing_retained) {
|
||||||
assert(extent_can_coalesce(ecache, inner, outer));
|
assert(extent_can_coalesce(ecache, inner, outer));
|
||||||
@ -1086,7 +1086,7 @@ extent_coalesce(tsdn_t *tsdn, arena_t *arena, ehooks_t *ehooks,
|
|||||||
extent_activate_locked(tsdn, ecache, outer);
|
extent_activate_locked(tsdn, ecache, outer);
|
||||||
|
|
||||||
malloc_mutex_unlock(tsdn, &ecache->mtx);
|
malloc_mutex_unlock(tsdn, &ecache->mtx);
|
||||||
bool err = extent_merge_impl(tsdn, ehooks, &arena->edata_cache,
|
bool err = extent_merge_impl(tsdn, ehooks, edata_cache,
|
||||||
forward ? inner : outer, forward ? outer : inner, growing_retained);
|
forward ? inner : outer, forward ? outer : inner, growing_retained);
|
||||||
malloc_mutex_lock(tsdn, &ecache->mtx);
|
malloc_mutex_lock(tsdn, &ecache->mtx);
|
||||||
|
|
||||||
@ -1128,9 +1128,9 @@ extent_try_coalesce_impl(tsdn_t *tsdn, arena_t *arena, ehooks_t *ehooks,
|
|||||||
|
|
||||||
extent_unlock_edata(tsdn, next);
|
extent_unlock_edata(tsdn, next);
|
||||||
|
|
||||||
if (can_coalesce && !extent_coalesce(tsdn, arena,
|
if (can_coalesce && !extent_coalesce(tsdn,
|
||||||
ehooks, ecache, edata, next, true,
|
&arena->edata_cache, ehooks, ecache, edata, next,
|
||||||
growing_retained)) {
|
true, growing_retained)) {
|
||||||
if (ecache->delay_coalesce) {
|
if (ecache->delay_coalesce) {
|
||||||
/* Do minimal coalescing. */
|
/* Do minimal coalescing. */
|
||||||
*coalesced = true;
|
*coalesced = true;
|
||||||
@ -1148,9 +1148,9 @@ extent_try_coalesce_impl(tsdn_t *tsdn, arena_t *arena, ehooks_t *ehooks,
|
|||||||
prev);
|
prev);
|
||||||
extent_unlock_edata(tsdn, prev);
|
extent_unlock_edata(tsdn, prev);
|
||||||
|
|
||||||
if (can_coalesce && !extent_coalesce(tsdn, arena,
|
if (can_coalesce && !extent_coalesce(tsdn,
|
||||||
ehooks, ecache, edata, prev, false,
|
&arena->edata_cache, ehooks, ecache, edata, prev,
|
||||||
growing_retained)) {
|
false, growing_retained)) {
|
||||||
edata = prev;
|
edata = prev;
|
||||||
if (ecache->delay_coalesce) {
|
if (ecache->delay_coalesce) {
|
||||||
/* Do minimal coalescing. */
|
/* Do minimal coalescing. */
|
||||||
|
Loading…
Reference in New Issue
Block a user