Embed root node into rtree_t.
This avoids one atomic operation per tree access.
This commit is contained in:
@@ -39,13 +39,17 @@ struct rtree_ctx_s {
|
||||
#ifndef _MSC_VER
|
||||
JEMALLOC_ALIGNED(CACHELINE)
|
||||
#endif
|
||||
rtree_ctx_cache_elm_t cache[RTREE_CTX_NCACHE];
|
||||
rtree_ctx_cache_elm_t cache[RTREE_CTX_NCACHE];
|
||||
};
|
||||
|
||||
struct rtree_s {
|
||||
/* An rtree_{internal,leaf}_elm_t *. */
|
||||
atomic_p_t root;
|
||||
malloc_mutex_t init_lock;
|
||||
malloc_mutex_t init_lock;
|
||||
/* Number of elements based on rtree_levels[0].bits. */
|
||||
#if RTREE_HEIGHT > 1
|
||||
rtree_node_elm_t root[1U << (RTREE_NSB/RTREE_HEIGHT)];
|
||||
#else
|
||||
rtree_leaf_elm_t root[1U << (RTREE_NSB/RTREE_HEIGHT)];
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif /* JEMALLOC_INTERNAL_RTREE_STRUCTS_H */
|
||||
|
Reference in New Issue
Block a user