| 305 | } |
| 306 | |
| 307 | static void |
| 308 | tcache_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 | |
| 334 | void |
| 335 | tcache_arena_reassociate(tsdn_t *tsdn, tcache_t *tcache, arena_t *arena) { |
no test coverage detected