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

Function irealloc_prof_sample

deps/jemalloc/src/jemalloc.c:2505–2526  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2503}
2504
2505static void *
2506irealloc_prof_sample(tsd_t *tsd, void *old_ptr, size_t old_usize, size_t usize,
2507 prof_tctx_t *tctx, hook_ralloc_args_t *hook_args) {
2508 void *p;
2509
2510 if (tctx == NULL) {
2511 return NULL;
2512 }
2513 if (usize <= SC_SMALL_MAXCLASS) {
2514 p = iralloc(tsd, old_ptr, old_usize,
2515 SC_LARGE_MINCLASS, 0, false, hook_args);
2516 if (p == NULL) {
2517 return NULL;
2518 }
2519 arena_prof_promote(tsd_tsdn(tsd), p, usize);
2520 } else {
2521 p = iralloc(tsd, old_ptr, old_usize, usize, 0, false,
2522 hook_args);
2523 }
2524
2525 return p;
2526}
2527
2528JEMALLOC_ALWAYS_INLINE void *
2529irealloc_prof(tsd_t *tsd, void *old_ptr, size_t old_usize, size_t usize,

Callers 1

irealloc_profFunction · 0.70

Calls 3

arena_prof_promoteFunction · 0.70
irallocFunction · 0.50
tsd_tsdnFunction · 0.50

Tested by

no test coverage detected