mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-15 21:27:18 +03:00
Refactor arena_is_auto.
This commit is contained in:
parent
94a88c26f4
commit
79522b2fc2
3 changed files with 10 additions and 4 deletions
|
|
@ -25,6 +25,9 @@ extern unsigned ncpus;
|
|||
/* Number of arenas used for automatic multiplexing of threads and arenas. */
|
||||
extern unsigned narenas_auto;
|
||||
|
||||
/* Base index for manual arenas. */
|
||||
extern unsigned manual_arena_base;
|
||||
|
||||
/*
|
||||
* Arenas that are used to service external requests. Not all elements of the
|
||||
* arenas array are necessarily used; arenas are created lazily as needed.
|
||||
|
|
|
|||
|
|
@ -71,9 +71,8 @@ arena_ichoose(tsd_t *tsd, arena_t *arena) {
|
|||
static inline bool
|
||||
arena_is_auto(arena_t *arena) {
|
||||
assert(narenas_auto > 0);
|
||||
unsigned offset = (opt_huge_threshold != 0) ? 1 : 0;
|
||||
|
||||
return (arena_ind_get(arena) < narenas_auto + offset);
|
||||
return (arena_ind_get(arena) < manual_arena_base);
|
||||
}
|
||||
|
||||
JEMALLOC_ALWAYS_INLINE extent_t *
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue