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

Function je_dallocx

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

Source from the content-addressed store, hash-verified

2917}
2918
2919JEMALLOC_EXPORT void JEMALLOC_NOTHROW
2920je_dallocx(void *ptr, int flags) {
2921 LOG("core.dallocx.entry", "ptr: %p, flags: %d", ptr, flags);
2922
2923 assert(ptr != NULL);
2924 assert(malloc_initialized() || IS_INITIALIZER);
2925
2926 tsd_t *tsd = tsd_fetch();
2927 bool fast = tsd_fast(tsd);
2928 check_entry_exit_locking(tsd_tsdn(tsd));
2929
2930 tcache_t *tcache;
2931 if (unlikely((flags & MALLOCX_TCACHE_MASK) != 0)) {
2932 /* Not allowed to be reentrant and specify a custom tcache. */
2933 assert(tsd_reentrancy_level_get(tsd) == 0);
2934 if ((flags & MALLOCX_TCACHE_MASK) == MALLOCX_TCACHE_NONE) {
2935 tcache = NULL;
2936 } else {
2937 tcache = tcaches_get(tsd, MALLOCX_TCACHE_GET(flags));
2938 }
2939 } else {
2940 if (likely(fast)) {
2941 tcache = tsd_tcachep_get(tsd);
2942 assert(tcache == tcache_get(tsd));
2943 } else {
2944 if (likely(tsd_reentrancy_level_get(tsd) == 0)) {
2945 tcache = tcache_get(tsd);
2946 } else {
2947 tcache = NULL;
2948 }
2949 }
2950 }
2951
2952 UTRACE(ptr, 0, 0);
2953 if (likely(fast)) {
2954 tsd_assert_fast(tsd);
2955 ifree(tsd, ptr, tcache, false);
2956 } else {
2957 ifree(tsd, ptr, tcache, true);
2958 }
2959 check_entry_exit_locking(tsd_tsdn(tsd));
2960
2961 LOG("core.dallocx.exit", "");
2962}
2963
2964JEMALLOC_ALWAYS_INLINE size_t
2965inallocx(tsdn_t *tsdn, size_t size, int flags) {

Callers

nothing calls this directly

Calls 9

malloc_initializedFunction · 0.85
tsd_fetchFunction · 0.85
tsd_fastFunction · 0.85
check_entry_exit_lockingFunction · 0.85
tsd_tsdnFunction · 0.85
tcaches_getFunction · 0.85
tcache_getFunction · 0.85
tsd_assert_fastFunction · 0.85
ifreeFunction · 0.85

Tested by

no test coverage detected