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

Function tcache_cleanup

deps/jemalloc/src/tcache.c:581–598  ·  view source on GitHub ↗

For auto tcache (embedded in TSD) only. */

Source from the content-addressed store, hash-verified

579
580/* For auto tcache (embedded in TSD) only. */
581void
582tcache_cleanup(tsd_t *tsd) {
583 tcache_t *tcache = tsd_tcachep_get(tsd);
584 if (!tcache_available(tsd)) {
585 assert(tsd_tcache_enabled_get(tsd) == false);
586 if (config_debug) {
587 assert(tcache_small_bin_get(tcache, 0)->avail == NULL);
588 }
589 return;
590 }
591 assert(tsd_tcache_enabled_get(tsd));
592 assert(tcache_small_bin_get(tcache, 0)->avail != NULL);
593
594 tcache_destroy(tsd, tcache, true);
595 if (config_debug) {
596 tcache_small_bin_get(tcache, 0)->avail = NULL;
597 }
598}
599
600void
601tcache_stats_merge(tsdn_t *tsdn, tcache_t *tcache, arena_t *arena) {

Callers 2

tsd_do_data_cleanupFunction · 0.70
tcache_enabled_setFunction · 0.50

Calls 2

tcache_destroyFunction · 0.70
tcache_availableFunction · 0.50

Tested by

no test coverage detected