| 2553 | } |
| 2554 | |
| 2555 | JEMALLOC_ALWAYS_INLINE void |
| 2556 | ifree(tsd_t *tsd, void *ptr, tcache_t *tcache, bool slow_path) { |
| 2557 | if (!slow_path) { |
| 2558 | tsd_assert_fast(tsd); |
| 2559 | } |
| 2560 | check_entry_exit_locking(tsd_tsdn(tsd)); |
| 2561 | if (tsd_reentrancy_level_get(tsd) != 0) { |
| 2562 | assert(slow_path); |
| 2563 | } |
| 2564 | |
| 2565 | assert(ptr != NULL); |
| 2566 | assert(malloc_initialized() || IS_INITIALIZER); |
| 2567 | |
| 2568 | alloc_ctx_t alloc_ctx; |
| 2569 | rtree_ctx_t *rtree_ctx = tsd_rtree_ctx(tsd); |
| 2570 | rtree_szind_slab_read(tsd_tsdn(tsd), &extents_rtree, rtree_ctx, |
| 2571 | (uintptr_t)ptr, true, &alloc_ctx.szind, &alloc_ctx.slab); |
| 2572 | assert(alloc_ctx.szind != SC_NSIZES); |
| 2573 | |
| 2574 | size_t usize; |
| 2575 | if (config_prof && opt_prof) { |
| 2576 | usize = sz_index2size(alloc_ctx.szind); |
| 2577 | prof_free(tsd, ptr, usize, &alloc_ctx); |
| 2578 | } else if (config_stats) { |
| 2579 | usize = sz_index2size(alloc_ctx.szind); |
| 2580 | } |
| 2581 | if (config_stats) { |
| 2582 | *tsd_thread_deallocatedp_get(tsd) += usize; |
| 2583 | } |
| 2584 | |
| 2585 | if (likely(!slow_path)) { |
| 2586 | idalloctm(tsd_tsdn(tsd), ptr, tcache, &alloc_ctx, false, |
| 2587 | false); |
| 2588 | } else { |
| 2589 | idalloctm(tsd_tsdn(tsd), ptr, tcache, &alloc_ctx, false, |
| 2590 | true); |
| 2591 | } |
| 2592 | } |
| 2593 | |
| 2594 | JEMALLOC_ALWAYS_INLINE void |
| 2595 | isfree(tsd_t *tsd, void *ptr, size_t usize, tcache_t *tcache, bool slow_path) { |
no test coverage detected