diff --git a/src/base.c b/src/base.c index 7502a657..dd4b109d 100644 --- a/src/base.c +++ b/src/base.c @@ -199,8 +199,14 @@ base_extent_alloc(tsdn_t *tsdn, base_t *base, size_t size, size_t alignment) { malloc_mutex_assert_owner(tsdn, &base->mtx); extent_hooks_t *extent_hooks = base_extent_hooks_get(base); + /* + * Drop mutex during base_block_alloc(), because an extent hook will be + * called. + */ + malloc_mutex_unlock(tsdn, &base->mtx); base_block_t *block = base_block_alloc(extent_hooks, base_ind_get(base), &base->pind_last, &base->extent_sn_next, size, alignment); + malloc_mutex_lock(tsdn, &base->mtx); if (block == NULL) { return NULL; }