Make arenas_lookup_ctl triable
This commit is contained in:
parent
dc0a184f8d
commit
019cccc293
10
src/ctl.c
10
src/ctl.c
@ -3215,19 +3215,21 @@ arenas_lookup_ctl(tsd_t *tsd, const size_t *mib,
|
|||||||
int ret;
|
int ret;
|
||||||
unsigned arena_ind;
|
unsigned arena_ind;
|
||||||
void *ptr;
|
void *ptr;
|
||||||
edata_t *edata;
|
emap_full_alloc_ctx_t alloc_ctx;
|
||||||
|
bool ptr_not_present;
|
||||||
arena_t *arena;
|
arena_t *arena;
|
||||||
|
|
||||||
ptr = NULL;
|
ptr = NULL;
|
||||||
ret = EINVAL;
|
ret = EINVAL;
|
||||||
malloc_mutex_lock(tsd_tsdn(tsd), &ctl_mtx);
|
malloc_mutex_lock(tsd_tsdn(tsd), &ctl_mtx);
|
||||||
WRITE(ptr, void *);
|
WRITE(ptr, void *);
|
||||||
edata = emap_edata_lookup(tsd_tsdn(tsd), &arena_emap_global, ptr);
|
ptr_not_present = emap_full_alloc_ctx_try_lookup(tsd_tsdn(tsd), &arena_emap_global, ptr,
|
||||||
if (edata == NULL) {
|
&alloc_ctx);
|
||||||
|
if (ptr_not_present) {
|
||||||
goto label_return;
|
goto label_return;
|
||||||
}
|
}
|
||||||
|
|
||||||
arena = arena_get_from_edata(edata);
|
arena = arena_get_from_edata(alloc_ctx.edata);
|
||||||
if (arena == NULL) {
|
if (arena == NULL) {
|
||||||
goto label_return;
|
goto label_return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user