1 #ifndef JEMALLOC_INTERNAL_ARENA_TYPES_H
2 #define JEMALLOC_INTERNAL_ARENA_TYPES_H
3 
4 /* Maximum number of regions in one slab. */
5 #define LG_SLAB_MAXREGS		(LG_PAGE - LG_TINY_MIN)
6 #define SLAB_MAXREGS		(1U << LG_SLAB_MAXREGS)
7 
8 /* Default decay times in milliseconds. */
9 #define DIRTY_DECAY_MS_DEFAULT	ZD(10 * 1000)
10 #define MUZZY_DECAY_MS_DEFAULT	ZD(10 * 1000)
11 /* Number of event ticks between time checks. */
12 #define DECAY_NTICKS_PER_UPDATE	1000
13 
14 typedef struct arena_slab_data_s arena_slab_data_t;
15 typedef struct arena_decay_s arena_decay_t;
16 typedef struct arena_s arena_t;
17 typedef struct arena_tdata_s arena_tdata_t;
18 typedef struct alloc_ctx_s alloc_ctx_t;
19 
20 typedef enum {
21 	percpu_arena_mode_names_base   = 0, /* Used for options processing. */
22 
23 	/*
24 	 * *_uninit are used only during bootstrapping, and must correspond
25 	 * to initialized variant plus percpu_arena_mode_enabled_base.
26 	 */
27 	percpu_arena_uninit            = 0,
28 	per_phycpu_arena_uninit        = 1,
29 
30 	/* All non-disabled modes must come after percpu_arena_disabled. */
31 	percpu_arena_disabled          = 2,
32 
33 	percpu_arena_mode_names_limit  = 3, /* Used for options processing. */
34 	percpu_arena_mode_enabled_base = 3,
35 
36 	percpu_arena                   = 3,
37 	per_phycpu_arena               = 4  /* Hyper threads share arena. */
38 } percpu_arena_mode_t;
39 
40 #define PERCPU_ARENA_ENABLED(m)	((m) >= percpu_arena_mode_enabled_base)
41 #define PERCPU_ARENA_DEFAULT	percpu_arena_disabled
42 
43 #endif /* JEMALLOC_INTERNAL_ARENA_TYPES_H */
44