MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / tcache_flush_cache

Function tcache_flush_cache

deps/jemalloc/src/tcache.c:511–537  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

509}
510
511static void
512tcache_flush_cache(tsd_t *tsd, tcache_t *tcache) {
513 assert(tcache->arena != NULL);
514
515 for (unsigned i = 0; i < SC_NBINS; i++) {
516 cache_bin_t *tbin = tcache_small_bin_get(tcache, i);
517 tcache_bin_flush_small(tsd, tcache, tbin, i, 0);
518
519 if (config_stats) {
520 assert(tbin->tstats.nrequests == 0);
521 }
522 }
523 for (unsigned i = SC_NBINS; i < nhbins; i++) {
524 cache_bin_t *tbin = tcache_large_bin_get(tcache, i);
525 tcache_bin_flush_large(tsd, tbin, i, 0, tcache);
526
527 if (config_stats) {
528 assert(tbin->tstats.nrequests == 0);
529 }
530 }
531
532 if (config_prof && tcache->prof_accumbytes > 0 &&
533 arena_prof_accum(tsd_tsdn(tsd), tcache->arena,
534 tcache->prof_accumbytes)) {
535 prof_idump(tsd_tsdn(tsd));
536 }
537}
538
539void
540tcache_flush(tsd_t *tsd) {

Callers 2

tcache_flushFunction · 0.70
tcache_destroyFunction · 0.70

Calls 5

tcache_bin_flush_smallFunction · 0.70
tcache_bin_flush_largeFunction · 0.70
prof_idumpFunction · 0.70
arena_prof_accumFunction · 0.50
tsd_tsdnFunction · 0.50

Tested by

no test coverage detected