| 2328 | } |
| 2329 | |
| 2330 | JEMALLOC_ALWAYS_INLINE tcache_t * |
| 2331 | tcache_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. */ |
| 2361 | JEMALLOC_ALWAYS_INLINE bool |
no test coverage detected