| 338 | } |
| 339 | |
| 340 | void |
| 341 | tcache_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 | |
| 361 | static void |
| 362 | tcache_arena_dissociate(tsdn_t *tsdn, tcache_t *tcache) { |
no test coverage detected