| 2861 | } |
| 2862 | |
| 2863 | JEMALLOC_ALWAYS_INLINE void |
| 2864 | ifree(tsd_t *tsd, void *ptr, tcache_t *tcache, bool slow_path) { |
| 2865 | if (!slow_path) { |
| 2866 | tsd_assert_fast(tsd); |
| 2867 | } |
| 2868 | check_entry_exit_locking(tsd_tsdn(tsd)); |
| 2869 | if (tsd_reentrancy_level_get(tsd) != 0) { |
| 2870 | assert(slow_path); |
| 2871 | } |
| 2872 | |
| 2873 | assert(ptr != NULL); |
| 2874 | assert(malloc_initialized() || IS_INITIALIZER); |
| 2875 | |
| 2876 | emap_alloc_ctx_t alloc_ctx; |
| 2877 | emap_alloc_ctx_lookup(tsd_tsdn(tsd), &arena_emap_global, ptr, |
| 2878 | &alloc_ctx); |
| 2879 | assert(alloc_ctx.szind != SC_NSIZES); |
| 2880 | |
| 2881 | size_t usize = sz_index2size(alloc_ctx.szind); |
| 2882 | if (config_prof && opt_prof) { |
| 2883 | prof_free(tsd, ptr, usize, &alloc_ctx); |
| 2884 | } |
| 2885 | |
| 2886 | if (likely(!slow_path)) { |
| 2887 | idalloctm(tsd_tsdn(tsd), ptr, tcache, &alloc_ctx, false, |
| 2888 | false); |
| 2889 | } else { |
| 2890 | if (config_fill && slow_path && opt_junk_free) { |
| 2891 | junk_free_callback(ptr, usize); |
| 2892 | } |
| 2893 | idalloctm(tsd_tsdn(tsd), ptr, tcache, &alloc_ctx, false, |
| 2894 | true); |
| 2895 | } |
| 2896 | thread_dalloc_event(tsd, usize); |
| 2897 | } |
| 2898 | |
| 2899 | JEMALLOC_ALWAYS_INLINE bool |
| 2900 | maybe_check_alloc_ctx(tsd_t *tsd, void *ptr, emap_alloc_ctx_t *alloc_ctx) { |
no test coverage detected