mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-23 13:13:06 +00:00
Push event handlers to constituent modules
This commit is contained in:
14
src/stats.c
14
src/stats.c
@@ -1493,11 +1493,6 @@ stats_print(write_cb_t *write_cb, void *cbopaque, const char *opts) {
|
||||
emitter_end(&emitter);
|
||||
}
|
||||
|
||||
bool
|
||||
stats_interval_accum(tsd_t *tsd, uint64_t bytes) {
|
||||
return counter_accum(tsd_tsdn(tsd), &stats_interval_accumulated, bytes);
|
||||
}
|
||||
|
||||
uint64_t
|
||||
stats_interval_new_event_wait(tsd_t *tsd) {
|
||||
return stats_interval_accum_batch;
|
||||
@@ -1508,6 +1503,15 @@ stats_interval_postponed_event_wait(tsd_t *tsd) {
|
||||
return TE_MIN_START_WAIT;
|
||||
}
|
||||
|
||||
void
|
||||
stats_interval_event_handler(tsd_t *tsd, uint64_t elapsed) {
|
||||
assert(elapsed > 0 && elapsed != TE_INVALID_ELAPSED);
|
||||
if (counter_accum(tsd_tsdn(tsd), &stats_interval_accumulated,
|
||||
elapsed)) {
|
||||
je_malloc_stats_print(NULL, NULL, opt_stats_interval_opts);
|
||||
}
|
||||
}
|
||||
|
||||
bool
|
||||
stats_boot(void) {
|
||||
uint64_t stats_interval;
|
||||
|
||||
Reference in New Issue
Block a user