MCPcopy Create free account
hub / github.com/beefytech/Beef / je_dallocx

Function je_dallocx

BeefRT/JEMalloc/src/jemalloc.c:3868–3895  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3866}
3867
3868JEMALLOC_EXPORT void JEMALLOC_NOTHROW
3869je_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
3897JEMALLOC_ALWAYS_INLINE size_t
3898inallocx(tsdn_t *tsdn, size_t size, int flags) {

Callers

nothing calls this directly

Calls 11

malloc_initializedFunction · 0.85
tsd_fetch_minFunction · 0.85
tsd_fastFunction · 0.85
check_entry_exit_lockingFunction · 0.85
tsd_tsdnFunction · 0.85
mallocx_tcache_getFunction · 0.85
tcache_get_from_indFunction · 0.85
tsd_assert_fastFunction · 0.85
ifreeFunction · 0.85
hook_invoke_dallocFunction · 0.85
LOGFunction · 0.50

Tested by

no test coverage detected