Header refactoring: tsd - cleanup and dependency breaking.
This removes the tsd macros (which are used only for tsd_t in real builds). We break up the circular dependencies involving tsd. We also move all tsd access through getters and setters. This allows us to assert that we only touch data when tsd is in a valid state. We simplify the usages of the x macro trick, removing all the customizability (get/set, init, cleanup), moving the lifetime logic to tsd_init and tsd_cleanup. This lets us make initialization order independent of order within tsd_t.
This commit is contained in:
committed by
David Goldblatt
parent
c86c8f4ffb
commit
209f2926b8
@@ -30,15 +30,6 @@ struct rtree_leaf_elm_s {
|
||||
#endif
|
||||
};
|
||||
|
||||
struct rtree_leaf_elm_witness_s {
|
||||
const rtree_leaf_elm_t *elm;
|
||||
witness_t witness;
|
||||
};
|
||||
|
||||
struct rtree_leaf_elm_witness_tsd_s {
|
||||
rtree_leaf_elm_witness_t witnesses[RTREE_ELM_ACQUIRE_MAX];
|
||||
};
|
||||
|
||||
struct rtree_level_s {
|
||||
/* Number of key bits distinguished by this level. */
|
||||
unsigned bits;
|
||||
@@ -49,18 +40,6 @@ struct rtree_level_s {
|
||||
unsigned cumbits;
|
||||
};
|
||||
|
||||
struct rtree_ctx_cache_elm_s {
|
||||
uintptr_t leafkey;
|
||||
rtree_leaf_elm_t *leaf;
|
||||
};
|
||||
|
||||
struct rtree_ctx_s {
|
||||
/* Direct mapped cache. */
|
||||
rtree_ctx_cache_elm_t cache[RTREE_CTX_NCACHE];
|
||||
/* L2 LRU cache. */
|
||||
rtree_ctx_cache_elm_t l2_cache[RTREE_CTX_NCACHE_L2];
|
||||
};
|
||||
|
||||
struct rtree_s {
|
||||
malloc_mutex_t init_lock;
|
||||
/* Number of elements based on rtree_levels[0].bits. */
|
||||
|
Reference in New Issue
Block a user