blob: f45940c1144658f0df1e55a1ec26ff1a30f2dd3c [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 Evanse476f8a2010-01-16 09:53:50 -080012 /* Linkage for the size/address-ordered tree. */
Jason Evans6109fe02010-02-10 10:37:56 -080013 rb_node(extent_node_t) link_szad;
Jason Evanse476f8a2010-01-16 09:53:50 -080014
15 /* Linkage for the address-ordered tree. */
Jason Evans6109fe02010-02-10 10:37:56 -080016 rb_node(extent_node_t) link_ad;
17
Jason Evanse476f8a2010-01-16 09:53:50 -080018 /* Pointer to the extent that this tree node is responsible for. */
Jason Evans6109fe02010-02-10 10:37:56 -080019 void *addr;
Jason Evanse476f8a2010-01-16 09:53:50 -080020
21 /* Total region size. */
Jason Evans6109fe02010-02-10 10:37:56 -080022 size_t size;
Jason Evans7de92762012-10-08 17:56:11 -070023
Jason Evanse12eaf92014-12-08 14:40:14 -080024 /* Arena from which this extent came, if any. */
aravindfb7fe502014-05-05 15:16:56 -070025 arena_t *arena;
26
Jason Evans918a1a52015-01-30 21:21:16 -080027 /*
28 * 'prof_tctx' and 'zeroed' are never needed at the same time, so
29 * overlay them in order to fit extent_node_t in one cache line.
30 */
31 union {
32 /* Profile counters, used for huge objects. */
33 prof_tctx_t *prof_tctx;
34
35 /* True if zero-filled; used by chunk recycling code. */
36 bool zeroed;
37 };
Jason Evanse476f8a2010-01-16 09:53:50 -080038};
39typedef rb_tree(extent_node_t) extent_tree_t;
40
41#endif /* JEMALLOC_H_STRUCTS */
42/******************************************************************************/
43#ifdef JEMALLOC_H_EXTERNS
44
Jason Evanse476f8a2010-01-16 09:53:50 -080045rb_proto(, extent_tree_szad_, extent_tree_t, extent_node_t)
Jason Evanse476f8a2010-01-16 09:53:50 -080046
47rb_proto(, extent_tree_ad_, extent_tree_t, extent_node_t)
48
49#endif /* JEMALLOC_H_EXTERNS */
50/******************************************************************************/
51#ifdef JEMALLOC_H_INLINES
52
53#endif /* JEMALLOC_H_INLINES */
54/******************************************************************************/
55