1#ifndef JEMALLOC_INTERNAL_BIN_STATS_H
2#define JEMALLOC_INTERNAL_BIN_STATS_H
3
4#include "jemalloc/internal/mutex_prof.h"
5
6typedef struct bin_stats_s bin_stats_t;
7struct 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 /*
18 * Number of allocation requests that correspond to the size of this
19 * bin. This includes requests served by tcache, though tcache only
20 * periodically merges into this counter.
21 */
22 uint64_t nrequests;
23
24 /*
25 * Current number of regions of this size class, including regions
26 * currently cached by tcache.
27 */
28 size_t curregs;
29
30 /* Number of tcache fills from this bin. */
31 uint64_t nfills;
32
33 /* Number of tcache flushes to this bin. */
34 uint64_t nflushes;
35
36 /* Total number of slabs created for this bin's size class. */
37 uint64_t nslabs;
38
39 /*
40 * Total number of slabs reused by extracting them from the slabs heap
41 * for this bin's size class.
42 */
43 uint64_t reslabs;
44
45 /* Current number of slabs in this bin. */
46 size_t curslabs;
47
48 /* Current size of nonfull slabs heap in this bin. */
49 size_t nonfull_slabs;
50};
51
52typedef struct bin_stats_data_s bin_stats_data_t;
53struct bin_stats_data_s {
54 bin_stats_t stats_data;
55 mutex_prof_data_t mutex_data;
56};
57#endif /* JEMALLOC_INTERNAL_BIN_STATS_H */
58