xref: /aosp_15_r20/external/jemalloc_new/include/jemalloc/internal/bin_stats.h (revision 1208bc7e437ced7eb82efac44ba17e3beba411da)
1 #ifndef JEMALLOC_INTERNAL_BIN_STATS_H
2 #define JEMALLOC_INTERNAL_BIN_STATS_H
3 
4 #include "jemalloc/internal/mutex_prof.h"
5 
6 typedef struct bin_stats_s bin_stats_t;
7 struct bin_stats_s {
8 	/*
9 	 * Total number of allocation/deallocation requests served directly by
10 	 * the bin.  Note that tcache may allocate an object, then recycle it
11 	 * many times, resulting many increments to nrequests, but only one
12 	 * each to nmalloc and ndalloc.
13 	 */
14 	uint64_t	nmalloc;
15 	uint64_t	ndalloc;
16 
17 #if !defined(ANDROID_MINIMIZE_STRUCTS)
18 	/*
19 	 * Number of allocation requests that correspond to the size of this
20 	 * bin.  This includes requests served by tcache, though tcache only
21 	 * periodically merges into this counter.
22 	 */
23 	uint64_t	nrequests;
24 #endif
25 
26 	/*
27 	 * Current number of regions of this size class, including regions
28 	 * currently cached by tcache.
29 	 */
30 	size_t		curregs;
31 
32 #if !defined(ANDROID_MINIMIZE_STRUCTS)
33 	/* Number of tcache fills from this bin. */
34 	uint64_t	nfills;
35 
36 	/* Number of tcache flushes to this bin. */
37 	uint64_t	nflushes;
38 
39 	/* Total number of slabs created for this bin's size class. */
40 	uint64_t	nslabs;
41 
42 	/*
43 	 * Total number of slabs reused by extracting them from the slabs heap
44 	 * for this bin's size class.
45 	 */
46 	uint64_t	reslabs;
47 
48 	/* Current number of slabs in this bin. */
49 	size_t		curslabs;
50 #endif
51 
52 	mutex_prof_data_t mutex_data;
53 };
54 
55 #endif /* JEMALLOC_INTERNAL_BIN_STATS_H */
56