MCPcopy Create free account
hub / github.com/F-Stack/f-stack / tcache_destroy

Function tcache_destroy

app/redis-6.2.6/deps/jemalloc/src/tcache.c:491–506  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

489}
490
491static void
492tcache_destroy(tsd_t *tsd, tcache_t *tcache, bool tsd_tcache) {
493 tcache_flush_cache(tsd, tcache);
494 tcache_arena_dissociate(tsd_tsdn(tsd), tcache);
495
496 if (tsd_tcache) {
497 /* Release the avail array for the TSD embedded auto tcache. */
498 void *avail_array =
499 (void *)((uintptr_t)tcache_small_bin_get(tcache, 0)->avail -
500 (uintptr_t)tcache_bin_info[0].ncached_max * sizeof(void *));
501 idalloctm(tsd_tsdn(tsd), avail_array, NULL, NULL, true, true);
502 } else {
503 /* Release both the tcache struct and avail array. */
504 idalloctm(tsd_tsdn(tsd), tcache, NULL, NULL, true, true);
505 }
506}
507
508/* For auto tcache (embedded in TSD) only. */
509void

Callers 3

tcache_cleanupFunction · 0.85
tcaches_flushFunction · 0.85
tcaches_destroyFunction · 0.85

Calls 4

tcache_flush_cacheFunction · 0.85
tcache_arena_dissociateFunction · 0.85
tsd_tsdnFunction · 0.85
idalloctmFunction · 0.85

Tested by

no test coverage detected