summaryrefslogtreecommitdiffstats
path: root/include/jemalloc
diff options
context:
space:
mode:
authorJason Evans <jasone@canonware.com>2017-03-24 18:25:43 (GMT)
committerJason Evans <jasone@canonware.com>2017-03-26 06:30:13 (GMT)
commit0591c204b468e7b273c2f3f94f488cffbe8d7a74 (patch)
treeae1eb7155c4f1679a4da6b89a9f05b7258889857 /include/jemalloc
parent5e12223925e3cbd1f7c314e9d0224e1fa597ccc7 (diff)
downloadjemalloc-0591c204b468e7b273c2f3f94f488cffbe8d7a74.zip
jemalloc-0591c204b468e7b273c2f3f94f488cffbe8d7a74.tar.gz
jemalloc-0591c204b468e7b273c2f3f94f488cffbe8d7a74.tar.bz2
Store arena index rather than (arena_t *) in extent_t.
Diffstat (limited to 'include/jemalloc')
-rw-r--r--include/jemalloc/internal/extent_inlines.h4
-rw-r--r--include/jemalloc/internal/extent_structs.h4
-rw-r--r--include/jemalloc/internal/jemalloc_internal.h.in2
3 files changed, 5 insertions, 5 deletions
diff --git a/include/jemalloc/internal/extent_inlines.h b/include/jemalloc/internal/extent_inlines.h
index 56f306d..f86822d 100644
--- a/include/jemalloc/internal/extent_inlines.h
+++ b/include/jemalloc/internal/extent_inlines.h
@@ -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
diff --git a/include/jemalloc/internal/extent_structs.h b/include/jemalloc/internal/extent_structs.h
index 5cf3c9b..1b2b4bc 100644
--- a/include/jemalloc/internal/extent_structs.h
+++ b/include/jemalloc/internal/extent_structs.h
@@ -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;
diff --git a/include/jemalloc/internal/jemalloc_internal.h.in b/include/jemalloc/internal/jemalloc_internal.h.in
index 2fe2101..4255b63 100644
--- a/include/jemalloc/internal/jemalloc_internal.h.in
+++ b/include/jemalloc/internal/jemalloc_internal.h.in
@@ -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);