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

Function tcache_arena_dissociate

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

Source from the content-addressed store, hash-verified

305}
306
307static void
308tcache_arena_dissociate(tsdn_t *tsdn, tcache_t *tcache) {
309 arena_t *arena = tcache->arena;
310 assert(arena != NULL);
311 if (config_stats) {
312 /* Unlink from list of extant tcaches. */
313 malloc_mutex_lock(tsdn, &arena->tcache_ql_mtx);
314 if (config_debug) {
315 bool in_ql = false;
316 tcache_t *iter;
317 ql_foreach(iter, &arena->tcache_ql, link) {
318 if (iter == tcache) {
319 in_ql = true;
320 break;
321 }
322 }
323 assert(in_ql);
324 }
325 ql_remove(&arena->tcache_ql, tcache, link);
326 ql_remove(&arena->cache_bin_array_descriptor_ql,
327 &tcache->cache_bin_array_descriptor, link);
328 tcache_stats_merge(tsdn, tcache, arena);
329 malloc_mutex_unlock(tsdn, &arena->tcache_ql_mtx);
330 }
331 tcache->arena = NULL;
332}
333
334void
335tcache_arena_reassociate(tsdn_t *tsdn, tcache_t *tcache, arena_t *arena) {

Callers 2

tcache_arena_reassociateFunction · 0.85
tcache_destroyFunction · 0.85

Calls 4

malloc_mutex_lockFunction · 0.85
ql_foreachFunction · 0.85
tcache_stats_mergeFunction · 0.85
malloc_mutex_unlockFunction · 0.85

Tested by

no test coverage detected