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

Function tcache_arena_associate

deps/jemalloc/src/tcache.c:340–359  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

338}
339
340void
341tcache_arena_associate(tsdn_t *tsdn, tcache_t *tcache, arena_t *arena) {
342 assert(tcache->arena == NULL);
343 tcache->arena = arena;
344
345 if (config_stats) {
346 /* Link into list of extant tcaches. */
347 malloc_mutex_lock(tsdn, &arena->tcache_ql_mtx);
348
349 ql_elm_new(tcache, link);
350 ql_tail_insert(&arena->tcache_ql, tcache, link);
351 cache_bin_array_descriptor_init(
352 &tcache->cache_bin_array_descriptor, tcache->bins_small,
353 tcache->bins_large);
354 ql_tail_insert(&arena->cache_bin_array_descriptor_ql,
355 &tcache->cache_bin_array_descriptor, link);
356
357 malloc_mutex_unlock(tsdn, &arena->tcache_ql_mtx);
358 }
359}
360
361static void
362tcache_arena_dissociate(tsdn_t *tsdn, tcache_t *tcache) {

Callers 4

tcache_arena_reassociateFunction · 0.70
tsd_tcache_data_initFunction · 0.70
tcache_create_explicitFunction · 0.70
arena_choose_implFunction · 0.50

Calls 3

malloc_mutex_lockFunction · 0.50
malloc_mutex_unlockFunction · 0.50

Tested by

no test coverage detected