1 #ifndef JEMALLOC_INTERNAL_BASE_STRUCTS_H
2 #define JEMALLOC_INTERNAL_BASE_STRUCTS_H
3 
4 /* Embedded at the beginning of every block of base-managed virtual memory. */
5 struct base_block_s {
6 	/* Total size of block's virtual memory mapping. */
7 	size_t		size;
8 
9 	/* Next block in list of base's blocks. */
10 	base_block_t	*next;
11 
12 	/* Tracks unused trailing space. */
13 	extent_t	extent;
14 };
15 
16 struct base_s {
17 	/* Associated arena's index within the arenas array. */
18 	unsigned	ind;
19 
20 	/* User-configurable extent hook functions. */
21 	union {
22 		extent_hooks_t	*extent_hooks;
23 		void		*extent_hooks_pun;
24 	};
25 
26 	/* Protects base_alloc() and base_stats_get() operations. */
27 	malloc_mutex_t	mtx;
28 
29 	/* Serial number generation state. */
30 	size_t		extent_sn_next;
31 
32 	/* Chain of all blocks associated with base. */
33 	base_block_t	*blocks;
34 
35 	/* Heap of extents that track unused trailing space within blocks. */
36 	extent_heap_t	avail[NSIZES];
37 
38 	/* Stats, only maintained if config_stats. */
39 	size_t		allocated;
40 	size_t		resident;
41 	size_t		mapped;
42 };
43 
44 #endif /* JEMALLOC_INTERNAL_BASE_STRUCTS_H */
45