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

Function sdallocx_default

BeefRT/JEMalloc/src/jemalloc.c:3907–3931  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3905}
3906
3907JEMALLOC_NOINLINE void
3908sdallocx_default(void *ptr, size_t size, int flags) {
3909 assert(ptr != NULL);
3910 assert(malloc_initialized() || IS_INITIALIZER);
3911
3912 tsd_t *tsd = tsd_fetch_min();
3913 bool fast = tsd_fast(tsd);
3914 size_t usize = inallocx(tsd_tsdn(tsd), size, flags);
3915 check_entry_exit_locking(tsd_tsdn(tsd));
3916
3917 unsigned tcache_ind = mallocx_tcache_get(flags);
3918 tcache_t *tcache = tcache_get_from_ind(tsd, tcache_ind, !fast,
3919 /* is_alloc */ false);
3920
3921 UTRACE(ptr, 0, 0);
3922 if (likely(fast)) {
3923 tsd_assert_fast(tsd);
3924 isfree(tsd, ptr, usize, tcache, false);
3925 } else {
3926 uintptr_t args_raw[3] = {(uintptr_t)ptr, size, flags};
3927 hook_invoke_dalloc(hook_dalloc_sdallocx, ptr, args_raw);
3928 isfree(tsd, ptr, usize, tcache, true);
3929 }
3930 check_entry_exit_locking(tsd_tsdn(tsd));
3931}
3932
3933JEMALLOC_EXPORT void JEMALLOC_NOTHROW
3934je_sdallocx(void *ptr, size_t size, int flags) {

Callers 2

je_sdallocxFunction · 0.85
je_sdallocx_noflagsFunction · 0.85

Calls 11

malloc_initializedFunction · 0.85
tsd_fetch_minFunction · 0.85
tsd_fastFunction · 0.85
inallocxFunction · 0.85
tsd_tsdnFunction · 0.85
check_entry_exit_lockingFunction · 0.85
mallocx_tcache_getFunction · 0.85
tcache_get_from_indFunction · 0.85
tsd_assert_fastFunction · 0.85
isfreeFunction · 0.85
hook_invoke_dallocFunction · 0.85

Tested by

no test coverage detected