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

Function large_dalloc_prep_impl

deps/jemalloc/src/large.c:321–341  ·  view source on GitHub ↗

* junked_locked indicates whether the extent's data have been junk-filled, and * whether the arena's large_mtx is currently held. */

Source from the content-addressed store, hash-verified

319 * whether the arena's large_mtx is currently held.
320 */
321static void
322large_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
343static void
344large_dalloc_finish_impl(tsdn_t *tsdn, arena_t *arena, extent_t *extent) {

Callers 2

large_dallocFunction · 0.70

Calls 8

arena_is_autoFunction · 0.50
malloc_mutex_lockFunction · 0.50
extent_list_removeFunction · 0.50
malloc_mutex_unlockFunction · 0.50
extent_addr_getFunction · 0.50
extent_usize_getFunction · 0.50

Tested by

no test coverage detected