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

Function irallocx_prof_sample

deps/memkind/src/jemalloc/src/jemalloc.c:2471–2493  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2469}
2470
2471static void *
2472irallocx_prof_sample(tsdn_t *tsdn, void *old_ptr, size_t old_usize,
2473 size_t usize, size_t alignment, bool zero, tcache_t *tcache, arena_t *arena,
2474 prof_tctx_t *tctx) {
2475 void *p;
2476
2477 if (tctx == NULL) {
2478 return NULL;
2479 }
2480 if (usize <= SMALL_MAXCLASS) {
2481 p = iralloct(tsdn, old_ptr, old_usize, LARGE_MINCLASS,
2482 alignment, zero, tcache, arena);
2483 if (p == NULL) {
2484 return NULL;
2485 }
2486 arena_prof_promote(tsdn, p, usize);
2487 } else {
2488 p = iralloct(tsdn, old_ptr, old_usize, usize, alignment, zero,
2489 tcache, arena);
2490 }
2491
2492 return p;
2493}
2494
2495JEMALLOC_ALWAYS_INLINE void *
2496irallocx_prof(tsd_t *tsd, void *old_ptr, size_t old_usize, size_t size,

Callers 1

irallocx_profFunction · 0.70

Calls 2

arena_prof_promoteFunction · 0.70
iralloctFunction · 0.50

Tested by

no test coverage detected