1 #ifndef JEMALLOC_INTERNAL_ARENA_TYPES_H
2 #define JEMALLOC_INTERNAL_ARENA_TYPES_H
4 #include "jemalloc/internal/sc.h"
6 /* Maximum number of regions in one slab. */
7 #define LG_SLAB_MAXREGS (LG_PAGE - SC_LG_TINY_MIN)
8 #define SLAB_MAXREGS (1U << LG_SLAB_MAXREGS)
10 /* Default decay times in milliseconds. */
11 #define DIRTY_DECAY_MS_DEFAULT ZD(10 * 1000)
12 #define MUZZY_DECAY_MS_DEFAULT (0)
13 /* Number of event ticks between time checks. */
14 #define DECAY_NTICKS_PER_UPDATE 1000
16 typedef struct arena_slab_data_s arena_slab_data_t;
17 typedef struct arena_decay_s arena_decay_t;
18 typedef struct arena_s arena_t;
19 typedef struct arena_tdata_s arena_tdata_t;
20 typedef struct alloc_ctx_s alloc_ctx_t;
23 percpu_arena_mode_names_base = 0, /* Used for options processing. */
26 * *_uninit are used only during bootstrapping, and must correspond
27 * to initialized variant plus percpu_arena_mode_enabled_base.
29 percpu_arena_uninit = 0,
30 per_phycpu_arena_uninit = 1,
32 /* All non-disabled modes must come after percpu_arena_disabled. */
33 percpu_arena_disabled = 2,
35 percpu_arena_mode_names_limit = 3, /* Used for options processing. */
36 percpu_arena_mode_enabled_base = 3,
39 per_phycpu_arena = 4 /* Hyper threads share arena. */
40 } percpu_arena_mode_t;
42 #define PERCPU_ARENA_ENABLED(m) ((m) >= percpu_arena_mode_enabled_base)
43 #define PERCPU_ARENA_DEFAULT percpu_arena_disabled
46 * When allocation_size >= oversize_threshold, use the dedicated huge arena
47 * (unless have explicitly spicified arena index). 0 disables the feature.
49 #define OVERSIZE_THRESHOLD_DEFAULT (8 << 20)
51 #endif /* JEMALLOC_INTERNAL_ARENA_TYPES_H */