Make tsd cleanup functions optional, remove noop cleanup functions.
This commit is contained in:
@@ -561,20 +561,20 @@ struct tsd_init_head_s {
|
||||
#endif
|
||||
|
||||
#define MALLOC_TSD \
|
||||
/* O(name, type) */ \
|
||||
O(tcache, tcache_t *) \
|
||||
O(thread_allocated, uint64_t) \
|
||||
O(thread_deallocated, uint64_t) \
|
||||
O(prof_tdata, prof_tdata_t *) \
|
||||
O(iarena, arena_t *) \
|
||||
O(arena, arena_t *) \
|
||||
O(arenas_tdata, arena_tdata_t *) \
|
||||
O(narenas_tdata, unsigned) \
|
||||
O(arenas_tdata_bypass, bool) \
|
||||
O(tcache_enabled, tcache_enabled_t) \
|
||||
O(witnesses, witness_list_t) \
|
||||
O(rtree_elm_witnesses, rtree_elm_witness_tsd_t) \
|
||||
O(witness_fork, bool) \
|
||||
/* O(name, type, cleanup) */ \
|
||||
O(tcache, tcache_t *, yes) \
|
||||
O(thread_allocated, uint64_t, no) \
|
||||
O(thread_deallocated, uint64_t, no) \
|
||||
O(prof_tdata, prof_tdata_t *, yes) \
|
||||
O(iarena, arena_t *, yes) \
|
||||
O(arena, arena_t *, yes) \
|
||||
O(arenas_tdata, arena_tdata_t *, yes) \
|
||||
O(narenas_tdata, unsigned, no) \
|
||||
O(arenas_tdata_bypass, bool, no) \
|
||||
O(tcache_enabled, tcache_enabled_t, no) \
|
||||
O(witnesses, witness_list_t, yes) \
|
||||
O(rtree_elm_witnesses, rtree_elm_witness_tsd_t,no) \
|
||||
O(witness_fork, bool, no) \
|
||||
|
||||
#define TSD_INITIALIZER { \
|
||||
tsd_state_uninitialized, \
|
||||
@@ -595,7 +595,7 @@ struct tsd_init_head_s {
|
||||
|
||||
struct tsd_s {
|
||||
tsd_state_t state;
|
||||
#define O(n, t) \
|
||||
#define O(n, t, c) \
|
||||
t n;
|
||||
MALLOC_TSD
|
||||
#undef O
|
||||
@@ -642,7 +642,7 @@ malloc_tsd_protos(JEMALLOC_ATTR(unused), , tsd_t)
|
||||
tsd_t *tsd_fetch(void);
|
||||
tsdn_t *tsd_tsdn(tsd_t *tsd);
|
||||
bool tsd_nominal(tsd_t *tsd);
|
||||
#define O(n, t) \
|
||||
#define O(n, t, c) \
|
||||
t *tsd_##n##p_get(tsd_t *tsd); \
|
||||
t tsd_##n##_get(tsd_t *tsd); \
|
||||
void tsd_##n##_set(tsd_t *tsd, t n);
|
||||
@@ -691,7 +691,7 @@ tsd_nominal(tsd_t *tsd)
|
||||
return (tsd->state == tsd_state_nominal);
|
||||
}
|
||||
|
||||
#define O(n, t) \
|
||||
#define O(n, t, c) \
|
||||
JEMALLOC_ALWAYS_INLINE t * \
|
||||
tsd_##n##p_get(tsd_t *tsd) \
|
||||
{ \
|
||||
|
Reference in New Issue
Block a user