From 492e9f301eeb980e880d307214fd441264986324 Mon Sep 17 00:00:00 2001 From: Qi Wang Date: Tue, 4 Apr 2017 11:09:45 -0700 Subject: [PATCH] Make the tsd member init functions to take tsd_t * type. --- include/jemalloc/internal/rtree_externs.h | 3 ++- src/rtree.c | 7 ++++++- src/tsd.c | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/include/jemalloc/internal/rtree_externs.h b/include/jemalloc/internal/rtree_externs.h index 482f6ba3..c8d1c376 100644 --- a/include/jemalloc/internal/rtree_externs.h +++ b/include/jemalloc/internal/rtree_externs.h @@ -43,6 +43,7 @@ void rtree_leaf_elm_witness_access(tsdn_t *tsdn, const rtree_t *rtree, const rtree_leaf_elm_t *elm); void rtree_leaf_elm_witness_release(tsdn_t *tsdn, const rtree_t *rtree, const rtree_leaf_elm_t *elm); -bool rtree_ctx_data_init(rtree_ctx_t *ctx); +void rtree_ctx_data_init(rtree_ctx_t *ctx); +bool tsd_rtree_ctx_data_init(tsd_t *tsd); #endif /* JEMALLOC_INTERNAL_RTREE_EXTERNS_H */ diff --git a/src/rtree.c b/src/rtree.c index b2c6824f..de4990bd 100644 --- a/src/rtree.c +++ b/src/rtree.c @@ -425,13 +425,18 @@ rtree_leaf_elm_witness_release(tsdn_t *tsdn, const rtree_t *rtree, rtree_leaf_elm_witness_dalloc(tsdn_tsd(tsdn), witness, elm); } -bool +void rtree_ctx_data_init(rtree_ctx_t *ctx) { for (unsigned i = 0; i < RTREE_CTX_NCACHE; i++) { rtree_ctx_cache_elm_t *cache = &ctx->cache[i]; cache->leafkey = RTREE_LEAFKEY_INVALID; cache->leaf = NULL; } +} + +bool +tsd_rtree_ctx_data_init(tsd_t *tsd) { + rtree_ctx_data_init(&tsd->rtree_ctx); return false; } diff --git a/src/tsd.c b/src/tsd.c index 6b68c001..86502116 100644 --- a/src/tsd.c +++ b/src/tsd.c @@ -64,7 +64,7 @@ bool tsd_data_init(void *arg) { tsd_t *tsd = (tsd_t *)arg; #define MALLOC_TSD_init_yes(n, t) \ - if (n##_data_init(&tsd->n)) { \ + if (tsd_##n##_data_init(tsd)) { \ return true; \ } #define MALLOC_TSD_init_no(n, t)