MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ifree

Function ifree

app/redis-6.2.6/deps/jemalloc/src/jemalloc.c:2191–2228  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2189}
2190
2191JEMALLOC_ALWAYS_INLINE void
2192ifree(tsd_t *tsd, void *ptr, tcache_t *tcache, bool slow_path) {
2193 if (!slow_path) {
2194 tsd_assert_fast(tsd);
2195 }
2196 check_entry_exit_locking(tsd_tsdn(tsd));
2197 if (tsd_reentrancy_level_get(tsd) != 0) {
2198 assert(slow_path);
2199 }
2200
2201 assert(ptr != NULL);
2202 assert(malloc_initialized() || IS_INITIALIZER);
2203
2204 alloc_ctx_t alloc_ctx;
2205 rtree_ctx_t *rtree_ctx = tsd_rtree_ctx(tsd);
2206 rtree_szind_slab_read(tsd_tsdn(tsd), &extents_rtree, rtree_ctx,
2207 (uintptr_t)ptr, true, &alloc_ctx.szind, &alloc_ctx.slab);
2208 assert(alloc_ctx.szind != NSIZES);
2209
2210 size_t usize;
2211 if (config_prof && opt_prof) {
2212 usize = sz_index2size(alloc_ctx.szind);
2213 prof_free(tsd, ptr, usize, &alloc_ctx);
2214 } else if (config_stats) {
2215 usize = sz_index2size(alloc_ctx.szind);
2216 }
2217 if (config_stats) {
2218 *tsd_thread_deallocatedp_get(tsd) += usize;
2219 }
2220
2221 if (likely(!slow_path)) {
2222 idalloctm(tsd_tsdn(tsd), ptr, tcache, &alloc_ctx, false,
2223 false);
2224 } else {
2225 idalloctm(tsd_tsdn(tsd), ptr, tcache, &alloc_ctx, false,
2226 true);
2227 }
2228}
2229
2230JEMALLOC_ALWAYS_INLINE void
2231isfree(tsd_t *tsd, void *ptr, size_t usize, tcache_t *tcache, bool slow_path) {

Callers 3

jemalloc.cFile · 0.85
je_freeFunction · 0.85
je_dallocxFunction · 0.85

Calls 8

tsd_assert_fastFunction · 0.85
check_entry_exit_lockingFunction · 0.85
tsd_tsdnFunction · 0.85
malloc_initializedFunction · 0.85
rtree_szind_slab_readFunction · 0.85
sz_index2sizeFunction · 0.85
prof_freeFunction · 0.85
idalloctmFunction · 0.85

Tested by

no test coverage detected