summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQi Wang <interwq@gwu.edu>2017-06-15 22:16:18 (GMT)
committerQi Wang <interwq@gmail.com>2017-06-16 00:55:53 (GMT)
commitae93fb08e21284f025871e9f5daccf3d0329b99b (patch)
tree3bbf35b8e184c2dda01ae2147230b8ee901f34f1
parent84f6c2cae0fb1399377ef6aea9368444c4987cc6 (diff)
downloadjemalloc-ae93fb08e21284f025871e9f5daccf3d0329b99b.zip
jemalloc-ae93fb08e21284f025871e9f5daccf3d0329b99b.tar.gz
jemalloc-ae93fb08e21284f025871e9f5daccf3d0329b99b.tar.bz2
Pass tsd to tcache_flush().
-rw-r--r--include/jemalloc/internal/tcache_externs.h2
-rw-r--r--src/ctl.c2
-rw-r--r--src/tcache.c3
3 files changed, 3 insertions, 4 deletions
diff --git a/include/jemalloc/internal/tcache_externs.h b/include/jemalloc/internal/tcache_externs.h
index abe133f..db3e9c7 100644
--- a/include/jemalloc/internal/tcache_externs.h
+++ b/include/jemalloc/internal/tcache_externs.h
@@ -48,7 +48,7 @@ void tcache_arena_associate(tsdn_t *tsdn, tcache_t *tcache, arena_t *arena);
void tcache_prefork(tsdn_t *tsdn);
void tcache_postfork_parent(tsdn_t *tsdn);
void tcache_postfork_child(tsdn_t *tsdn);
-void tcache_flush(void);
+void tcache_flush(tsd_t *tsd);
bool tsd_tcache_data_init(tsd_t *tsd);
bool tsd_tcache_enabled_data_init(tsd_t *tsd);
diff --git a/src/ctl.c b/src/ctl.c
index f1310cd..dfbeddd 100644
--- a/src/ctl.c
+++ b/src/ctl.c
@@ -1696,7 +1696,7 @@ thread_tcache_flush_ctl(tsd_t *tsd, const size_t *mib, size_t miblen,
READONLY();
WRITEONLY();
- tcache_flush();
+ tcache_flush(tsd);
ret = 0;
label_return:
diff --git a/src/tcache.c b/src/tcache.c
index 6355805..936ef31 100644
--- a/src/tcache.c
+++ b/src/tcache.c
@@ -474,8 +474,7 @@ tcache_flush_cache(tsd_t *tsd, tcache_t *tcache) {
}
void
-tcache_flush(void) {
- tsd_t *tsd = tsd_fetch();
+tcache_flush(tsd_t *tsd) {
assert(tcache_available(tsd));
tcache_flush_cache(tsd, tsd_tcachep_get(tsd));
}