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

Function large_dalloc_prep_impl

deps/memkind/src/jemalloc/src/large.c:308–327  ·  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

306 * whether the arena's large_mtx is currently held.
307 */
308static void
309large_dalloc_prep_impl(tsdn_t *tsdn, arena_t *arena, extent_t *extent,
310 bool junked_locked) {
311 if (!junked_locked) {
312 /* See comments in arena_bin_slabs_full_insert(). */
313 if (!arena_is_auto(arena)) {
314 malloc_mutex_lock(tsdn, &arena->large_mtx);
315 extent_list_remove(&arena->large, extent);
316 malloc_mutex_unlock(tsdn, &arena->large_mtx);
317 }
318 large_dalloc_maybe_junk(extent_addr_get(extent),
319 extent_usize_get(extent));
320 } else {
321 malloc_mutex_assert_owner(tsdn, &arena->large_mtx);
322 if (!arena_is_auto(arena)) {
323 extent_list_remove(&arena->large, extent);
324 }
325 }
326 arena_extent_dalloc_large_prep(tsdn, arena, extent);
327}
328
329static void
330large_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