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

Function tcache_get_from_ind

BeefRT/JEMalloc/src/jemalloc.c:2330–2358  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2328}
2329
2330JEMALLOC_ALWAYS_INLINE tcache_t *
2331tcache_get_from_ind(tsd_t *tsd, unsigned tcache_ind, bool slow, bool is_alloc) {
2332 tcache_t *tcache;
2333 if (tcache_ind == TCACHE_IND_AUTOMATIC) {
2334 if (likely(!slow)) {
2335 /* Getting tcache ptr unconditionally. */
2336 tcache = tsd_tcachep_get(tsd);
2337 assert(tcache == tcache_get(tsd));
2338 } else if (is_alloc ||
2339 likely(tsd_reentrancy_level_get(tsd) == 0)) {
2340 tcache = tcache_get(tsd);
2341 } else {
2342 tcache = NULL;
2343 }
2344 } else {
2345 /*
2346 * Should not specify tcache on deallocation path when being
2347 * reentrant.
2348 */
2349 assert(is_alloc || tsd_reentrancy_level_get(tsd) == 0 ||
2350 tsd_state_nocleanup(tsd));
2351 if (tcache_ind == TCACHE_IND_NONE) {
2352 tcache = NULL;
2353 } else {
2354 tcache = tcaches_get(tsd, tcache_ind);
2355 }
2356 }
2357 return tcache;
2358}
2359
2360/* Return true if a manual arena is specified and arena_get() OOMs. */
2361JEMALLOC_ALWAYS_INLINE bool

Callers 8

imalloc_no_sampleFunction · 0.85
free_defaultFunction · 0.85
free_fastpathFunction · 0.85
do_rallocxFunction · 0.85
do_realloc_nonnull_zeroFunction · 0.85
je_dallocxFunction · 0.85
sdallocx_defaultFunction · 0.85
batch_allocFunction · 0.85

Calls 3

tcache_getFunction · 0.85
tsd_state_nocleanupFunction · 0.85
tcaches_getFunction · 0.85

Tested by

no test coverage detected