1 | #ifndef JEMALLOC_INTERNAL_ARENA_TYPES_H |
2 | #define JEMALLOC_INTERNAL_ARENA_TYPES_H |
3 | |
4 | #include "jemalloc/internal/sc.h" |
5 | |
6 | /* Default decay times in milliseconds. */ |
7 | #define DIRTY_DECAY_MS_DEFAULT ZD(10 * 1000) |
8 | #define MUZZY_DECAY_MS_DEFAULT (0) |
9 | /* Number of event ticks between time checks. */ |
10 | #define ARENA_DECAY_NTICKS_PER_UPDATE 1000 |
11 | |
12 | typedef struct arena_decay_s arena_decay_t; |
13 | typedef struct arena_s arena_t; |
14 | |
15 | typedef enum { |
16 | percpu_arena_mode_names_base = 0, /* Used for options processing. */ |
17 | |
18 | /* |
19 | * *_uninit are used only during bootstrapping, and must correspond |
20 | * to initialized variant plus percpu_arena_mode_enabled_base. |
21 | */ |
22 | percpu_arena_uninit = 0, |
23 | per_phycpu_arena_uninit = 1, |
24 | |
25 | /* All non-disabled modes must come after percpu_arena_disabled. */ |
26 | percpu_arena_disabled = 2, |
27 | |
28 | percpu_arena_mode_names_limit = 3, /* Used for options processing. */ |
29 | percpu_arena_mode_enabled_base = 3, |
30 | |
31 | percpu_arena = 3, |
32 | per_phycpu_arena = 4 /* Hyper threads share arena. */ |
33 | } percpu_arena_mode_t; |
34 | |
35 | #define PERCPU_ARENA_ENABLED(m) ((m) >= percpu_arena_mode_enabled_base) |
36 | #define PERCPU_ARENA_DEFAULT percpu_arena_disabled |
37 | |
38 | /* |
39 | * When allocation_size >= oversize_threshold, use the dedicated huge arena |
40 | * (unless have explicitly spicified arena index). 0 disables the feature. |
41 | */ |
42 | #define OVERSIZE_THRESHOLD_DEFAULT (8 << 20) |
43 | |
44 | struct arena_config_s { |
45 | /* extent hooks to be used for the arena */ |
46 | extent_hooks_t *extent_hooks; |
47 | |
48 | /* |
49 | * Use extent hooks for metadata (base) allocations when true. |
50 | */ |
51 | bool metadata_use_hooks; |
52 | }; |
53 | |
54 | typedef struct arena_config_s arena_config_t; |
55 | |
56 | extern const arena_config_t arena_config_default; |
57 | |
58 | #endif /* JEMALLOC_INTERNAL_ARENA_TYPES_H */ |
59 | |