blob: 885f475baedb06b8a02a8f3e92d6b3152ee95315 [file] [log] [blame]
Jason Evanse476f8a2010-01-16 09:53:50 -08001/******************************************************************************/
2#ifdef JEMALLOC_H_TYPES
3
4typedef struct extent_node_s extent_node_t;
5
6#endif /* JEMALLOC_H_TYPES */
7/******************************************************************************/
8#ifdef JEMALLOC_H_STRUCTS
9
10/* Tree of extents. */
11struct extent_node_s {
Jason Evanscbf3a6d2015-02-11 12:24:27 -080012 /* Arena from which this extent came, if any. */
13 arena_t *arena;
Jason Evans6109fe02010-02-10 10:37:56 -080014
Jason Evanse476f8a2010-01-16 09:53:50 -080015 /* Pointer to the extent that this tree node is responsible for. */
Jason Evans6109fe02010-02-10 10:37:56 -080016 void *addr;
Jason Evanse476f8a2010-01-16 09:53:50 -080017
Jason Evanscbf3a6d2015-02-11 12:24:27 -080018 /*
19 * Total region size, or 0 if this node corresponds to an arena chunk.
20 */
Jason Evans6109fe02010-02-10 10:37:56 -080021 size_t size;
Jason Evans7de92762012-10-08 17:56:11 -070022
Jason Evans918a1a52015-01-30 21:21:16 -080023 /*
24 * 'prof_tctx' and 'zeroed' are never needed at the same time, so
25 * overlay them in order to fit extent_node_t in one cache line.
26 */
27 union {
28 /* Profile counters, used for huge objects. */
29 prof_tctx_t *prof_tctx;
30
31 /* True if zero-filled; used by chunk recycling code. */
32 bool zeroed;
33 };
Jason Evanscbf3a6d2015-02-11 12:24:27 -080034
35 union {
36 /* Linkage for the size/address-ordered tree. */
Jason Evans2195ba42015-02-15 16:43:52 -080037 rb_node(extent_node_t) szad_link;
Jason Evanscbf3a6d2015-02-11 12:24:27 -080038
39 /* Linkage for huge allocations and cached chunks nodes. */
Jason Evans2195ba42015-02-15 16:43:52 -080040 ql_elm(extent_node_t) ql_link;
Jason Evanscbf3a6d2015-02-11 12:24:27 -080041 };
42
43 /* Linkage for the address-ordered tree. */
Jason Evans2195ba42015-02-15 16:43:52 -080044 rb_node(extent_node_t) ad_link;
Jason Evanse476f8a2010-01-16 09:53:50 -080045};
46typedef rb_tree(extent_node_t) extent_tree_t;
47
48#endif /* JEMALLOC_H_STRUCTS */
49/******************************************************************************/
50#ifdef JEMALLOC_H_EXTERNS
51
Jason Evanse476f8a2010-01-16 09:53:50 -080052rb_proto(, extent_tree_szad_, extent_tree_t, extent_node_t)
Jason Evanse476f8a2010-01-16 09:53:50 -080053
54rb_proto(, extent_tree_ad_, extent_tree_t, extent_node_t)
55
56#endif /* JEMALLOC_H_EXTERNS */
57/******************************************************************************/
58#ifdef JEMALLOC_H_INLINES
59
60#endif /* JEMALLOC_H_INLINES */
61/******************************************************************************/
62