MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / irealloc_prof

Function irealloc_prof

deps/memkind/src/jemalloc/src/jemalloc.c:2086–2109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2084}
2085
2086JEMALLOC_ALWAYS_INLINE void *
2087irealloc_prof(tsd_t *tsd, void *old_ptr, size_t old_usize, size_t usize,
2088 alloc_ctx_t *alloc_ctx) {
2089 void *p;
2090 bool prof_active;
2091 prof_tctx_t *old_tctx, *tctx;
2092
2093 prof_active = prof_active_get_unlocked();
2094 old_tctx = prof_tctx_get(tsd_tsdn(tsd), old_ptr, alloc_ctx);
2095 tctx = prof_alloc_prep(tsd, usize, prof_active, true);
2096 if (unlikely((uintptr_t)tctx != (uintptr_t)1U)) {
2097 p = irealloc_prof_sample(tsd, old_ptr, old_usize, usize, tctx);
2098 } else {
2099 p = iralloc(tsd, old_ptr, old_usize, usize, 0, false);
2100 }
2101 if (unlikely(p == NULL)) {
2102 prof_alloc_rollback(tsd, tctx, true);
2103 return NULL;
2104 }
2105 prof_realloc(tsd, p, usize, tctx, prof_active, true, old_ptr, old_usize,
2106 old_tctx);
2107
2108 return p;
2109}
2110
2111JEMALLOC_ALWAYS_INLINE void
2112ifree(tsd_t *tsd, void *ptr, tcache_t *tcache, bool slow_path) {

Callers 1

jemalloc.cFile · 0.70

Calls 5

irealloc_prof_sampleFunction · 0.70
prof_active_get_unlockedFunction · 0.50
tsd_tsdnFunction · 0.50
irallocFunction · 0.50
prof_reallocFunction · 0.50

Tested by

no test coverage detected