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

Function irallocx_prof_sample

BeefRT/JEMalloc/src/jemalloc.c:3435–3461  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3433}
3434
3435static void *
3436irallocx_prof_sample(tsdn_t *tsdn, void *old_ptr, size_t old_usize,
3437 size_t usize, size_t alignment, bool zero, tcache_t *tcache, arena_t *arena,
3438 prof_tctx_t *tctx, hook_ralloc_args_t *hook_args) {
3439 void *p;
3440
3441 if (tctx == NULL) {
3442 return NULL;
3443 }
3444
3445 alignment = prof_sample_align(alignment);
3446 if (usize <= SC_SMALL_MAXCLASS) {
3447 p = iralloct(tsdn, old_ptr, old_usize,
3448 SC_LARGE_MINCLASS, alignment, zero, tcache,
3449 arena, hook_args);
3450 if (p == NULL) {
3451 return NULL;
3452 }
3453 arena_prof_promote(tsdn, p, usize);
3454 } else {
3455 p = iralloct(tsdn, old_ptr, old_usize, usize, alignment, zero,
3456 tcache, arena, hook_args);
3457 }
3458 assert(prof_sample_aligned(p));
3459
3460 return p;
3461}
3462
3463JEMALLOC_ALWAYS_INLINE void *
3464irallocx_prof(tsd_t *tsd, void *old_ptr, size_t old_usize, size_t size,

Callers 1

irallocx_profFunction · 0.85

Calls 4

prof_sample_alignFunction · 0.85
iralloctFunction · 0.85
arena_prof_promoteFunction · 0.85
prof_sample_alignedFunction · 0.85

Tested by

no test coverage detected