From adfd9d7b1d69a997a74193bf9d03951616f22ba6 Mon Sep 17 00:00:00 2001 From: Yinan Zhang Date: Tue, 31 Mar 2020 10:43:04 -0700 Subject: [PATCH] Change tsdn to tsd for thread name allocation --- include/jemalloc/internal/prof_data.h | 2 +- src/prof.c | 2 +- src/prof_data.c | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/jemalloc/internal/prof_data.h b/include/jemalloc/internal/prof_data.h index 6c6c5345..26b8b28e 100644 --- a/include/jemalloc/internal/prof_data.h +++ b/include/jemalloc/internal/prof_data.h @@ -10,7 +10,7 @@ void prof_bt_hash(const void *key, size_t r_hash[2]); bool prof_bt_keycomp(const void *k1, const void *k2); bool prof_data_init(tsd_t *tsd); -char *prof_thread_name_alloc(tsdn_t *tsdn, const char *thread_name); +char *prof_thread_name_alloc(tsd_t *tsd, const char *thread_name); int prof_thread_name_set_impl(tsd_t *tsd, const char *thread_name); bool prof_dump(tsd_t *tsd, bool propagate_err, const char *filename, bool leakcheck); diff --git a/src/prof.c b/src/prof.c index 14577461..29eb3e6b 100644 --- a/src/prof.c +++ b/src/prof.c @@ -746,7 +746,7 @@ prof_tdata_reinit(tsd_t *tsd, prof_tdata_t *tdata) { uint64_t thr_uid = tdata->thr_uid; uint64_t thr_discrim = tdata->thr_discrim + 1; char *thread_name = (tdata->thread_name != NULL) ? - prof_thread_name_alloc(tsd_tsdn(tsd), tdata->thread_name) : NULL; + prof_thread_name_alloc(tsd, tdata->thread_name) : NULL; bool active = tdata->active; prof_tdata_detach(tsd, tdata); diff --git a/src/prof_data.c b/src/prof_data.c index d2ad3748..9563293f 100644 --- a/src/prof_data.c +++ b/src/prof_data.c @@ -474,7 +474,7 @@ prof_bt_count(void) { } char * -prof_thread_name_alloc(tsdn_t *tsdn, const char *thread_name) { +prof_thread_name_alloc(tsd_t *tsd, const char *thread_name) { char *ret; size_t size; @@ -487,8 +487,8 @@ prof_thread_name_alloc(tsdn_t *tsdn, const char *thread_name) { return ""; } - ret = iallocztm(tsdn, size, sz_size2index(size), false, NULL, true, - arena_get(TSDN_NULL, 0, true), true); + ret = iallocztm(tsd_tsdn(tsd), size, sz_size2index(size), false, NULL, + true, arena_get(TSDN_NULL, 0, true), true); if (ret == NULL) { return NULL; } @@ -520,7 +520,7 @@ prof_thread_name_set_impl(tsd_t *tsd, const char *thread_name) { } } - s = prof_thread_name_alloc(tsd_tsdn(tsd), thread_name); + s = prof_thread_name_alloc(tsd, thread_name); if (s == NULL) { return EAGAIN; }