1 #ifndef JEMALLOC_INTERNAL_TCACHE_STRUCTS_H
2 #define JEMALLOC_INTERNAL_TCACHE_STRUCTS_H
4 #include "jemalloc/internal/ql.h"
5 #include "jemalloc/internal/size_classes.h"
6 #include "jemalloc/internal/cache_bin.h"
7 #include "jemalloc/internal/ticker.h"
11 * To minimize our cache-footprint, we put the frequently accessed data
12 * together at the start of this struct.
15 /* Cleared after arena_prof_accum(). */
16 uint64_t prof_accumbytes;
17 /* Drives incremental GC. */
20 * The pointer stacks associated with bins follow as a contiguous array.
21 * During tcache initialization, the avail pointer in each element of
22 * tbins is initialized to point to the proper offset within this array.
24 cache_bin_t bins_small[NBINS];
27 * This data is less hot; we can be a little less careful with our
30 /* Lets us track all the tcaches in an arena. */
31 ql_elm(tcache_t) link;
33 * The descriptor lets the arena find our cache bins without seeing the
34 * tcache definition. This enables arenas to aggregate stats across
35 * tcaches without having a tcache dependency.
37 cache_bin_array_descriptor_t cache_bin_array_descriptor;
39 /* The arena this tcache is associated with. */
43 /* For small bins, fill (ncached_max >> lg_fill_div). */
44 uint8_t lg_fill_div[NBINS];
46 * We put the cache bins for large size classes at the end of the
47 * struct, since some of them might not get used. This might end up
48 * letting us avoid touching an extra page if we don't have to.
50 cache_bin_t bins_large[NSIZES-NBINS];
53 /* Linkage for list of available (previously used) explicit tcache IDs. */
61 #endif /* JEMALLOC_INTERNAL_TCACHE_STRUCTS_H */