* junked_locked indicates whether the extent's data have been junk-filled, and * whether the arena's large_mtx is currently held. */
| 319 | * whether the arena's large_mtx is currently held. |
| 320 | */ |
| 321 | static void |
| 322 | large_dalloc_prep_impl(tsdn_t *tsdn, arena_t *arena, extent_t *extent, |
| 323 | bool junked_locked) { |
| 324 | if (!junked_locked) { |
| 325 | /* See comments in arena_bin_slabs_full_insert(). */ |
| 326 | if (!arena_is_auto(arena)) { |
| 327 | malloc_mutex_lock(tsdn, &arena->large_mtx); |
| 328 | extent_list_remove(&arena->large, extent); |
| 329 | malloc_mutex_unlock(tsdn, &arena->large_mtx); |
| 330 | } |
| 331 | large_dalloc_maybe_junk(extent_addr_get(extent), |
| 332 | extent_usize_get(extent)); |
| 333 | } else { |
| 334 | /* Only hold the large_mtx if necessary. */ |
| 335 | if (!arena_is_auto(arena)) { |
| 336 | malloc_mutex_assert_owner(tsdn, &arena->large_mtx); |
| 337 | extent_list_remove(&arena->large, extent); |
| 338 | } |
| 339 | } |
| 340 | arena_extent_dalloc_large_prep(tsdn, arena, extent); |
| 341 | } |
| 342 | |
| 343 | static void |
| 344 | large_dalloc_finish_impl(tsdn_t *tsdn, arena_t *arena, extent_t *extent) { |
no test coverage detected