2010-01-17 01:53:50 +08:00
|
|
|
/******************************************************************************/
|
|
|
|
#ifdef JEMALLOC_H_TYPES
|
|
|
|
|
|
|
|
typedef struct extent_node_s extent_node_t;
|
|
|
|
|
|
|
|
#endif /* JEMALLOC_H_TYPES */
|
|
|
|
/******************************************************************************/
|
|
|
|
#ifdef JEMALLOC_H_STRUCTS
|
|
|
|
|
|
|
|
/* Tree of extents. */
|
|
|
|
struct extent_node_s {
|
|
|
|
/* Linkage for the size/address-ordered tree. */
|
2010-02-11 02:37:56 +08:00
|
|
|
rb_node(extent_node_t) link_szad;
|
2010-01-17 01:53:50 +08:00
|
|
|
|
|
|
|
/* Linkage for the address-ordered tree. */
|
2010-02-11 02:37:56 +08:00
|
|
|
rb_node(extent_node_t) link_ad;
|
|
|
|
|
2010-01-17 01:53:50 +08:00
|
|
|
/* Pointer to the extent that this tree node is responsible for. */
|
2010-02-11 02:37:56 +08:00
|
|
|
void *addr;
|
2010-01-17 01:53:50 +08:00
|
|
|
|
|
|
|
/* Total region size. */
|
2010-02-11 02:37:56 +08:00
|
|
|
size_t size;
|
2012-10-09 08:56:11 +08:00
|
|
|
|
2014-12-09 06:40:14 +08:00
|
|
|
/* Arena from which this extent came, if any. */
|
2014-05-06 06:16:56 +08:00
|
|
|
arena_t *arena;
|
|
|
|
|
2015-01-31 13:21:16 +08:00
|
|
|
/*
|
|
|
|
* 'prof_tctx' and 'zeroed' are never needed at the same time, so
|
|
|
|
* overlay them in order to fit extent_node_t in one cache line.
|
|
|
|
*/
|
|
|
|
union {
|
|
|
|
/* Profile counters, used for huge objects. */
|
|
|
|
prof_tctx_t *prof_tctx;
|
|
|
|
|
|
|
|
/* True if zero-filled; used by chunk recycling code. */
|
|
|
|
bool zeroed;
|
|
|
|
};
|
2010-01-17 01:53:50 +08:00
|
|
|
};
|
|
|
|
typedef rb_tree(extent_node_t) extent_tree_t;
|
|
|
|
|
|
|
|
#endif /* JEMALLOC_H_STRUCTS */
|
|
|
|
/******************************************************************************/
|
|
|
|
#ifdef JEMALLOC_H_EXTERNS
|
|
|
|
|
|
|
|
rb_proto(, extent_tree_szad_, extent_tree_t, extent_node_t)
|
|
|
|
|
|
|
|
rb_proto(, extent_tree_ad_, extent_tree_t, extent_node_t)
|
|
|
|
|
|
|
|
#endif /* JEMALLOC_H_EXTERNS */
|
|
|
|
/******************************************************************************/
|
|
|
|
#ifdef JEMALLOC_H_INLINES
|
|
|
|
|
|
|
|
#endif /* JEMALLOC_H_INLINES */
|
|
|
|
/******************************************************************************/
|
|
|
|
|