Arena: Add helper function arena_get_from_extent.

This commit is contained in:
David T. Goldblatt
2019-09-23 18:05:57 -07:00
committed by David Goldblatt
parent c97d255752
commit 3d84bd57f4
4 changed files with 20 additions and 29 deletions

View File

@@ -8,6 +8,12 @@
#include "jemalloc/internal/sz.h"
#include "jemalloc/internal/ticker.h"
static inline arena_t *
arena_get_from_extent(extent_t *extent) {
return (arena_t *)atomic_load_p(&arenas[extent_arena_ind_get(extent)],
ATOMIC_RELAXED);
}
JEMALLOC_ALWAYS_INLINE bool
arena_has_default_hooks(arena_t *arena) {
return (extent_hooks_get(arena) == &extent_hooks_default);