| 359 | } |
| 360 | |
| 361 | static void |
| 362 | tcache_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 | |
| 388 | void |
| 389 | tcache_arena_reassociate(tsdn_t *tsdn, tcache_t *tcache, arena_t *arena) { |
no test coverage detected