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

Function tcache_arena_dissociate

deps/jemalloc/src/tcache.c:361–386  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

359}
360
361static void
362tcache_arena_dissociate(tsdn_t *tsdn, tcache_t *tcache) {
363 arena_t *arena = tcache->arena;
364 assert(arena != NULL);
365 if (config_stats) {
366 /* Unlink from list of extant tcaches. */
367 malloc_mutex_lock(tsdn, &arena->tcache_ql_mtx);
368 if (config_debug) {
369 bool in_ql = false;
370 tcache_t *iter;
371 ql_foreach(iter, &arena->tcache_ql, link) {
372 if (iter == tcache) {
373 in_ql = true;
374 break;
375 }
376 }
377 assert(in_ql);
378 }
379 ql_remove(&arena->tcache_ql, tcache, link);
380 ql_remove(&arena->cache_bin_array_descriptor_ql,
381 &tcache->cache_bin_array_descriptor, link);
382 tcache_stats_merge(tsdn, tcache, arena);
383 malloc_mutex_unlock(tsdn, &arena->tcache_ql_mtx);
384 }
385 tcache->arena = NULL;
386}
387
388void
389tcache_arena_reassociate(tsdn_t *tsdn, tcache_t *tcache, arena_t *arena) {

Callers 2

tcache_arena_reassociateFunction · 0.70
tcache_destroyFunction · 0.70

Calls 4

tcache_stats_mergeFunction · 0.70
malloc_mutex_lockFunction · 0.50
ql_foreachFunction · 0.50
malloc_mutex_unlockFunction · 0.50

Tested by

no test coverage detected