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

Function irealloc_prof

deps/jemalloc/src/jemalloc.c:2528–2553  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2526}
2527
2528JEMALLOC_ALWAYS_INLINE void *
2529irealloc_prof(tsd_t *tsd, void *old_ptr, size_t old_usize, size_t usize,
2530 alloc_ctx_t *alloc_ctx, hook_ralloc_args_t *hook_args) {
2531 void *p;
2532 bool prof_active;
2533 prof_tctx_t *old_tctx, *tctx;
2534
2535 prof_active = prof_active_get_unlocked();
2536 old_tctx = prof_tctx_get(tsd_tsdn(tsd), old_ptr, alloc_ctx);
2537 tctx = prof_alloc_prep(tsd, usize, prof_active, true);
2538 if (unlikely((uintptr_t)tctx != (uintptr_t)1U)) {
2539 p = irealloc_prof_sample(tsd, old_ptr, old_usize, usize, tctx,
2540 hook_args);
2541 } else {
2542 p = iralloc(tsd, old_ptr, old_usize, usize, 0, false,
2543 hook_args);
2544 }
2545 if (unlikely(p == NULL)) {
2546 prof_alloc_rollback(tsd, tctx, true);
2547 return NULL;
2548 }
2549 prof_realloc(tsd, p, usize, tctx, prof_active, true, old_ptr, old_usize,
2550 old_tctx);
2551
2552 return p;
2553}
2554
2555JEMALLOC_ALWAYS_INLINE void
2556ifree(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