Store arena index rather than (arena_t *) in extent_t.

This commit is contained in:
Jason Evans 2017-03-24 11:25:43 -07:00
parent 5e12223925
commit 0591c204b4
3 changed files with 5 additions and 5 deletions

View File

@ -49,7 +49,7 @@ int extent_snad_comp(const extent_t *a, const extent_t *b);
#if (defined(JEMALLOC_ENABLE_INLINE) || defined(JEMALLOC_EXTENT_C_))
JEMALLOC_INLINE arena_t *
extent_arena_get(const extent_t *extent) {
return extent->e_arena;
return arenas[extent->e_arena_ind];
}
JEMALLOC_INLINE void *
@ -151,7 +151,7 @@ extent_prof_tctx_get(const extent_t *extent) {
JEMALLOC_INLINE void
extent_arena_set(extent_t *extent, arena_t *arena) {
extent->e_arena = arena;
extent->e_arena_ind = (arena != NULL) ? arena_ind_get(arena) : UINT_MAX;
}
JEMALLOC_INLINE void

View File

@ -10,8 +10,8 @@ typedef enum {
/* Extent (span of pages). Use accessor functions for e_* fields. */
struct extent_s {
/* Arena from which this extent came, if any. */
arena_t *e_arena;
/* Arena from which this extent came, or UINT_MAX if unassociated. */
unsigned e_arena_ind;
/* Pointer to the extent that this structure is responsible for. */
void *e_addr;

View File

@ -932,7 +932,6 @@ decay_ticker_get(tsd_t *tsd, unsigned ind) {
}
#endif
#include "jemalloc/internal/extent_inlines.h"
#include "jemalloc/internal/rtree_inlines.h"
#include "jemalloc/internal/base_inlines.h"
#include "jemalloc/internal/bitmap_inlines.h"
@ -942,6 +941,7 @@ decay_ticker_get(tsd_t *tsd, unsigned ind) {
*/
#include "jemalloc/internal/prof_inlines_a.h"
#include "jemalloc/internal/arena_inlines_a.h"
#include "jemalloc/internal/extent_inlines.h"
#ifndef JEMALLOC_ENABLE_INLINE
extent_t *iealloc(tsdn_t *tsdn, const void *ptr);