* 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). */
| 681 | * entrance or exit). |
| 682 | */ |
| 683 | JEMALLOC_ALWAYS_INLINE void |
| 684 | check_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. |
no test coverage detected