Set reentrancy when invoking customized extent hooks.

Customized extent hooks may malloc / free thus trigger reentry.  Support this
behavior by adding reentrancy on hook functions.
This commit is contained in:
Qi Wang 2017-06-22 15:36:41 -07:00 committed by Qi Wang
parent d49ac4c709
commit d6eb8ac8f3
5 changed files with 109 additions and 35 deletions

View file

@ -1257,7 +1257,7 @@ arena_destroy(tsd_t *tsd, arena_t *arena) {
* Destroy the base allocator, which manages all metadata ever mapped by
* this arena.
*/
base_delete(arena->base);
base_delete(tsd_tsdn(tsd), arena->base);
}
static extent_t *
@ -2061,7 +2061,7 @@ arena_new(tsdn_t *tsdn, unsigned ind, extent_hooks_t *extent_hooks) {
return arena;
label_error:
if (ind != 0) {
base_delete(base);
base_delete(tsdn, base);
}
return NULL;
}