| 3866 | } |
| 3867 | |
| 3868 | JEMALLOC_EXPORT void JEMALLOC_NOTHROW |
| 3869 | je_dallocx(void *ptr, int flags) { |
| 3870 | LOG("core.dallocx.entry", "ptr: %p, flags: %d", ptr, flags); |
| 3871 | |
| 3872 | assert(ptr != NULL); |
| 3873 | assert(malloc_initialized() || IS_INITIALIZER); |
| 3874 | |
| 3875 | tsd_t *tsd = tsd_fetch_min(); |
| 3876 | bool fast = tsd_fast(tsd); |
| 3877 | check_entry_exit_locking(tsd_tsdn(tsd)); |
| 3878 | |
| 3879 | unsigned tcache_ind = mallocx_tcache_get(flags); |
| 3880 | tcache_t *tcache = tcache_get_from_ind(tsd, tcache_ind, !fast, |
| 3881 | /* is_alloc */ false); |
| 3882 | |
| 3883 | UTRACE(ptr, 0, 0); |
| 3884 | if (likely(fast)) { |
| 3885 | tsd_assert_fast(tsd); |
| 3886 | ifree(tsd, ptr, tcache, false); |
| 3887 | } else { |
| 3888 | uintptr_t args_raw[3] = {(uintptr_t)ptr, flags}; |
| 3889 | hook_invoke_dalloc(hook_dalloc_dallocx, ptr, args_raw); |
| 3890 | ifree(tsd, ptr, tcache, true); |
| 3891 | } |
| 3892 | check_entry_exit_locking(tsd_tsdn(tsd)); |
| 3893 | |
| 3894 | LOG("core.dallocx.exit", ""); |
| 3895 | } |
| 3896 | |
| 3897 | JEMALLOC_ALWAYS_INLINE size_t |
| 3898 | inallocx(tsdn_t *tsdn, size_t size, int flags) { |
nothing calls this directly
no test coverage detected