From c0a05e6abaca7d23c2cc225abb1b59a1160632a0 Mon Sep 17 00:00:00 2001 From: Jason Evans Date: Tue, 3 Jan 2017 15:09:50 -0800 Subject: [PATCH] Move static ctl_epoch variable into ctl_stats_t (as epoch). --- include/jemalloc/internal/ctl.h | 1 + src/ctl.c | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/jemalloc/internal/ctl.h b/include/jemalloc/internal/ctl.h index dfb1e8ef..8550bf10 100644 --- a/include/jemalloc/internal/ctl.h +++ b/include/jemalloc/internal/ctl.h @@ -54,6 +54,7 @@ struct ctl_arena_stats_s { }; struct ctl_stats_s { + uint64_t epoch; size_t allocated; size_t active; size_t metadata; diff --git a/src/ctl.c b/src/ctl.c index d5b384c0..d39edbf8 100644 --- a/src/ctl.c +++ b/src/ctl.c @@ -10,7 +10,6 @@ */ static malloc_mutex_t ctl_mtx; static bool ctl_initialized; -static uint64_t ctl_epoch; static ctl_stats_t *ctl_stats; /******************************************************************************/ @@ -679,7 +678,7 @@ ctl_refresh(tsdn_t *tsdn) ctl_stats->retained = sstats->astats.retained; } - ctl_epoch++; + ctl_stats->epoch++; } static bool @@ -725,7 +724,7 @@ ctl_init(tsdn_t *tsdn) } } - ctl_epoch = 0; + ctl_stats->epoch = 0; ctl_refresh(tsdn); ctl_initialized = true; } @@ -1169,7 +1168,7 @@ epoch_ctl(tsd_t *tsd, const size_t *mib, size_t miblen, void *oldp, WRITE(newval, uint64_t); if (newp != NULL) ctl_refresh(tsd_tsdn(tsd)); - READ(ctl_epoch, uint64_t); + READ(ctl_stats->epoch, uint64_t); ret = 0; label_return: