2017-01-11 10:06:31 +08:00
|
|
|
#ifndef JEMALLOC_INTERNAL_RTREE_STRUCTS_H
|
|
|
|
#define JEMALLOC_INTERNAL_RTREE_STRUCTS_H
|
|
|
|
|
|
|
|
struct rtree_elm_s {
|
2017-03-10 06:49:32 +08:00
|
|
|
/* Either "rtree_elm_t *child;" or "extent_t *extent;". */
|
|
|
|
atomic_p_t child_or_extent;
|
2017-01-11 10:06:31 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct rtree_elm_witness_s {
|
|
|
|
const rtree_elm_t *elm;
|
|
|
|
witness_t witness;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct rtree_elm_witness_tsd_s {
|
|
|
|
rtree_elm_witness_t witnesses[RTREE_ELM_ACQUIRE_MAX];
|
|
|
|
};
|
|
|
|
|
|
|
|
struct rtree_level_s {
|
|
|
|
/* Number of key bits distinguished by this level. */
|
|
|
|
unsigned bits;
|
|
|
|
/*
|
|
|
|
* Cumulative number of key bits distinguished by traversing to
|
|
|
|
* corresponding tree level.
|
|
|
|
*/
|
|
|
|
unsigned cumbits;
|
|
|
|
};
|
|
|
|
|
2017-02-04 12:21:56 +08:00
|
|
|
struct rtree_ctx_cache_elm_s {
|
|
|
|
uintptr_t leafkey;
|
|
|
|
rtree_elm_t *leaf;
|
|
|
|
};
|
|
|
|
|
2017-01-11 10:06:31 +08:00
|
|
|
struct rtree_ctx_s {
|
2017-02-04 12:21:56 +08:00
|
|
|
#ifndef _MSC_VER
|
|
|
|
JEMALLOC_ALIGNED(CACHELINE)
|
|
|
|
#endif
|
|
|
|
rtree_ctx_cache_elm_t cache[RTREE_CTX_NCACHE];
|
2017-01-11 10:06:31 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct rtree_s {
|
2017-03-10 06:49:32 +08:00
|
|
|
/* An rtree_elm_t *. */
|
|
|
|
atomic_p_t root;
|
|
|
|
malloc_mutex_t init_lock;
|
2017-01-11 10:06:31 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* JEMALLOC_INTERNAL_RTREE_STRUCTS_H */
|