summaryrefslogtreecommitdiffstats
path: root/include/jemalloc
diff options
context:
space:
mode:
authorQi Wang <interwq@gwu.edu>2017-03-06 20:51:41 (GMT)
committerQi Wang <interwq@gmail.com>2017-03-07 20:58:11 (GMT)
commit01f47f11a67d1a2505cc1f21851c466651eba431 (patch)
treefa2975643500f96ce0a888aab1c8d6c9d2eb03ea /include/jemalloc
parentcdce93e4a3045bcf0d30409666d2d4c29818aec7 (diff)
downloadjemalloc-01f47f11a67d1a2505cc1f21851c466651eba431.zip
jemalloc-01f47f11a67d1a2505cc1f21851c466651eba431.tar.gz
jemalloc-01f47f11a67d1a2505cc1f21851c466651eba431.tar.bz2
Store associated arena in tcache.
This fixes tcache_flush for manual tcaches, which wasn't able to find the correct arena it associated with. Also changed the decay test to cover this case (by using manually created arenas).
Diffstat (limited to 'include/jemalloc')
-rw-r--r--include/jemalloc/internal/tcache_externs.h2
-rw-r--r--include/jemalloc/internal/tcache_structs.h1
2 files changed, 2 insertions, 1 deletions
diff --git a/include/jemalloc/internal/tcache_externs.h b/include/jemalloc/internal/tcache_externs.h
index 3e4a751..8364303 100644
--- a/include/jemalloc/internal/tcache_externs.h
+++ b/include/jemalloc/internal/tcache_externs.h
@@ -34,7 +34,7 @@ void tcache_bin_flush_small(tsd_t *tsd, tcache_t *tcache, tcache_bin_t *tbin,
void tcache_bin_flush_large(tsd_t *tsd, tcache_bin_t *tbin, szind_t binind,
unsigned rem, tcache_t *tcache);
void tcache_arena_reassociate(tsdn_t *tsdn, tcache_t *tcache,
- arena_t *oldarena, arena_t *newarena);
+ arena_t *arena);
tcache_t *tcache_get_hard(tsd_t *tsd);
tcache_t *tcache_create(tsdn_t *tsdn, arena_t *arena);
void tcache_cleanup(tsd_t *tsd);
diff --git a/include/jemalloc/internal/tcache_structs.h b/include/jemalloc/internal/tcache_structs.h
index a2b28af..a9b7031 100644
--- a/include/jemalloc/internal/tcache_structs.h
+++ b/include/jemalloc/internal/tcache_structs.h
@@ -35,6 +35,7 @@ struct tcache_s {
uint64_t prof_accumbytes;/* Cleared after arena_prof_accum(). */
ticker_t gc_ticker; /* Drives incremental GC. */
szind_t next_gc_bin; /* Next bin to GC. */
+ arena_t *arena; /* Associated arena. */
tcache_bin_t tbins[1]; /* Dynamically sized. */
/*
* The pointer stacks associated with tbins follow as a contiguous