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

Function check_entry_exit_locking

deps/jemalloc/src/jemalloc.c:683–701  ·  view source on GitHub ↗

* Ensure that we don't hold any locks upon entry to or exit from allocator * code (in a "broad" sense that doesn't count a reentrant allocation as an * entrance or exit). */

Source from the content-addressed store, hash-verified

681 * entrance or exit).
682 */
683JEMALLOC_ALWAYS_INLINE void
684check_entry_exit_locking(tsdn_t *tsdn) {
685 if (!config_debug) {
686 return;
687 }
688 if (tsdn_null(tsdn)) {
689 return;
690 }
691 tsd_t *tsd = tsdn_tsd(tsdn);
692 /*
693 * It's possible we hold locks at entry/exit if we're in a nested
694 * allocation.
695 */
696 int8_t reentrancy_level = tsd_reentrancy_level_get(tsd);
697 if (reentrancy_level != 0) {
698 return;
699 }
700 witness_assert_lockless(tsdn_witness_tsdp_get(tsdn));
701}
702
703/*
704 * End miscellaneous support functions.

Callers 14

imalloc_bodyFunction · 0.70
ifreeFunction · 0.70
isfreeFunction · 0.70
jemalloc.cFile · 0.70
free_defaultFunction · 0.70
je_xallocxFunction · 0.70
je_dallocxFunction · 0.70
inallocxFunction · 0.70
sdallocx_defaultFunction · 0.70
je_mallctlFunction · 0.70
je_mallctlnametomibFunction · 0.70
je_mallctlbymibFunction · 0.70

Calls 3

tsdn_nullFunction · 0.50
tsdn_tsdFunction · 0.50
witness_assert_locklessFunction · 0.50

Tested by

no test coverage detected