mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-05-28 23:57:34 +03:00
Stop checking head state in the merge hook.
Now that all merging go through try_acquire_edata_neighbor, the mergeablility checks (including head state checking) are done before reaching the merge hook. In other words, merge hook will never be called if the head state doesn't agree.
This commit is contained in:
parent
49b7d7f0a4
commit
add636596a
5 changed files with 42 additions and 56 deletions
20
src/emap.c
20
src/emap.c
|
|
@ -48,26 +48,6 @@ emap_update_edata_state(tsdn_t *tsdn, emap_t *emap, edata_t *edata,
|
|||
emap_assert_mapped(tsdn, emap, edata);
|
||||
}
|
||||
|
||||
static inline bool
|
||||
edata_neighbor_head_state_mergeable(bool edata_is_head,
|
||||
bool neighbor_is_head, bool forward) {
|
||||
/*
|
||||
* Head states checking: disallow merging if the higher addr extent is a
|
||||
* head extent. This helps preserve first-fit, and more importantly
|
||||
* makes sure no merge across arenas.
|
||||
*/
|
||||
if (forward) {
|
||||
if (neighbor_is_head) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
if (edata_is_head) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
edata_can_acquire_neighbor(edata_t *edata, rtree_contents_t contents,
|
||||
extent_pai_t pai, extent_state_t expected_state, bool forward,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue