Make tsd no-cleanup during tsd reincarnation.

Since tsd cleanup isn't guaranteed when reincarnated, we set up tsd in a way
that needs no cleanup, by making it going through slow path instead.
This commit is contained in:
Qi Wang
2017-06-06 21:44:39 -07:00
committed by Qi Wang
parent 29c2577ee0
commit 00869e39a3
4 changed files with 51 additions and 24 deletions

View File

@@ -154,7 +154,6 @@ void malloc_tsd_dalloc(void *wrapper);
void malloc_tsd_cleanup_register(bool (*f)(void));
tsd_t *malloc_tsd_boot0(void);
void malloc_tsd_boot1(void);
bool tsd_data_init(void *arg);
void tsd_cleanup(void *arg);
tsd_t *tsd_fetch_slow(tsd_t *tsd);
void tsd_slow_update(tsd_t *tsd);
@@ -228,6 +227,7 @@ MALLOC_TSD
#define O(n, t, nt) \
JEMALLOC_ALWAYS_INLINE void \
tsd_##n##_set(tsd_t *tsd, t val) { \
assert(tsd->state != tsd_state_reincarnated); \
*tsd_##n##p_get(tsd) = val; \
}
MALLOC_TSD