Emap: Move over deregistration boundary functions.

This commit is contained in:
David Goldblatt 2020-01-30 14:55:36 -08:00 committed by David Goldblatt
parent 9b5ca0b09d
commit 6513d9d923
3 changed files with 15 additions and 7 deletions

View File

@ -65,4 +65,7 @@ bool emap_register_boundary(tsdn_t *tsdn, emap_t *emap, rtree_ctx_t *rtree_ctx,
void emap_register_interior(tsdn_t *tsdn, emap_t *emap, rtree_ctx_t *rtree_ctx,
edata_t *edata, szind_t szind);
void emap_deregister_boundary(tsdn_t *tsdn, emap_t *emap,
rtree_ctx_t *rtree_ctx, edata_t *edata);
#endif /* JEMALLOC_INTERNAL_EMAP_H */

View File

@ -161,3 +161,14 @@ emap_register_interior(tsdn_t *tsdn, emap_t *emap, rtree_ctx_t *rtree_ctx,
LG_PAGE), edata, szind, true);
}
}
void
emap_deregister_boundary(tsdn_t *tsdn, emap_t *emap, rtree_ctx_t *rtree_ctx,
edata_t *edata) {
rtree_leaf_elm_t *elm_a, *elm_b;
emap_rtree_leaf_elms_lookup(tsdn, emap, rtree_ctx, edata,
true, false, &elm_a, &elm_b);
emap_rtree_write_acquired(tsdn, emap, elm_a, elm_b, NULL, SC_NSIZES,
false);
}

View File

@ -385,19 +385,13 @@ static void
extent_deregister_impl(tsdn_t *tsdn, edata_t *edata, bool gdump) {
rtree_ctx_t rtree_ctx_fallback;
rtree_ctx_t *rtree_ctx = tsdn_rtree_ctx(tsdn, &rtree_ctx_fallback);
rtree_leaf_elm_t *elm_a, *elm_b;
emap_rtree_leaf_elms_lookup(tsdn, &emap_global, rtree_ctx, edata,
true, false, &elm_a, &elm_b);
emap_lock_edata(tsdn, &emap_global, edata);
emap_rtree_write_acquired(tsdn, &emap_global, elm_a, elm_b, NULL,
SC_NSIZES, false);
emap_deregister_boundary(tsdn, &emap_global, rtree_ctx, edata);
if (edata_slab_get(edata)) {
extent_interior_deregister(tsdn, rtree_ctx, edata);
edata_slab_set(edata, false);
}
emap_unlock_edata(tsdn, &emap_global, edata);
if (config_prof && gdump) {