Fix shadowed variable usage.

Verified with EXTRA_CFLAGS=-Wshadow.
This commit is contained in:
Qi Wang
2021-12-22 17:24:58 -08:00
committed by Qi Wang
parent bd70d8fc0f
commit d038160f3b
26 changed files with 119 additions and 120 deletions

View File

@@ -20,7 +20,6 @@ percpu_arena_update(tsd_t *tsd, unsigned cpu) {
tcache_t *tcache = tcache_get(tsd);
if (tcache != NULL) {
tcache_slow_t *tcache_slow = tsd_tcache_slowp_get(tsd);
tcache_t *tcache = tsd_tcachep_get(tsd);
tcache_arena_reassociate(tsd_tsdn(tsd), tcache_slow,
tcache, newarena);
}

View File

@@ -18,7 +18,7 @@ typedef struct {
#endif
} nstime_t;
static const nstime_t zero = NSTIME_ZERO_INITIALIZER;
static const nstime_t nstime_zero = NSTIME_ZERO_INITIALIZER;
void nstime_init(nstime_t *time, uint64_t ns);
void nstime_init2(nstime_t *time, uint64_t sec, uint64_t nsec);
@@ -60,12 +60,12 @@ extern const char *prof_time_res_mode_names[];
JEMALLOC_ALWAYS_INLINE void
nstime_init_zero(nstime_t *time) {
nstime_copy(time, &zero);
nstime_copy(time, &nstime_zero);
}
JEMALLOC_ALWAYS_INLINE bool
nstime_equals_zero(nstime_t *time) {
int diff = nstime_compare(time, &zero);
int diff = nstime_compare(time, &nstime_zero);
assert(diff >= 0);
return diff == 0;
}

View File

@@ -32,7 +32,7 @@ extern bool opt_prof_sys_thread_name;
extern bool opt_prof_stats;
/* Accessed via prof_active_[gs]et{_unlocked,}(). */
extern bool prof_active;
extern bool prof_active_state;
/* Accessed via prof_gdump_[gs]et{_unlocked,}(). */
extern bool prof_gdump_val;

View File

@@ -12,7 +12,7 @@ prof_active_assert() {
* If opt_prof is off, then prof_active must always be off, regardless
* of whether prof_active_mtx is in effect or not.
*/
assert(opt_prof || !prof_active);
assert(opt_prof || !prof_active_state);
}
JEMALLOC_ALWAYS_INLINE bool
@@ -24,7 +24,7 @@ prof_active_get_unlocked(void) {
* prof_active in the fast path, so there are no guarantees regarding
* how long it will take for all threads to notice state changes.
*/
return prof_active;
return prof_active_state;
}
JEMALLOC_ALWAYS_INLINE bool