From ae93fb08e21284f025871e9f5daccf3d0329b99b Mon Sep 17 00:00:00 2001 From: Qi Wang Date: Thu, 15 Jun 2017 15:16:18 -0700 Subject: [PATCH] Pass tsd to tcache_flush(). --- include/jemalloc/internal/tcache_externs.h | 2 +- src/ctl.c | 2 +- src/tcache.c | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/include/jemalloc/internal/tcache_externs.h b/include/jemalloc/internal/tcache_externs.h index abe133fa..db3e9c7d 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 f1310cdf..dfbeddda 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 6355805b..936ef314 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)); }