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

Function irealloc_prof_sample

deps/memkind/src/jemalloc/src/jemalloc.c:2065–2084  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2063}
2064
2065static void *
2066irealloc_prof_sample(tsd_t *tsd, void *old_ptr, size_t old_usize, size_t usize,
2067 prof_tctx_t *tctx) {
2068 void *p;
2069
2070 if (tctx == NULL) {
2071 return NULL;
2072 }
2073 if (usize <= SMALL_MAXCLASS) {
2074 p = iralloc(tsd, old_ptr, old_usize, LARGE_MINCLASS, 0, false);
2075 if (p == NULL) {
2076 return NULL;
2077 }
2078 arena_prof_promote(tsd_tsdn(tsd), p, usize);
2079 } else {
2080 p = iralloc(tsd, old_ptr, old_usize, usize, 0, false);
2081 }
2082
2083 return p;
2084}
2085
2086JEMALLOC_ALWAYS_INLINE void *
2087irealloc_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