Move static ctl_epoch variable into ctl_stats_t (as epoch).

This commit is contained in:
Jason Evans 2017-01-03 15:09:50 -08:00
parent d778dd2afc
commit c0a05e6aba
2 changed files with 4 additions and 4 deletions

View File

@ -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;

View File

@ -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: