Remove extra incrementcounter / decrementcounter functions

This commit is contained in:
Ondřej Surý
2018-03-17 19:43:16 +00:00
parent 42dccefb37
commit ef368be4d1

View File

@@ -155,18 +155,6 @@ isc_stats_ncounters(isc_stats_t *stats) {
return (stats->ncounters);
}
static inline void
incrementcounter(isc_stats_t *stats, int counter) {
atomic_fetch_add_explicit(&stats->counters[counter], 1,
memory_order_relaxed);
}
static inline void
decrementcounter(isc_stats_t *stats, int counter) {
atomic_fetch_sub_explicit(&stats->counters[counter], 1,
memory_order_relaxed);
}
static void
copy_counters(isc_stats_t *stats) {
int i;
@@ -190,7 +178,8 @@ isc_stats_increment(isc_stats_t *stats, isc_statscounter_t counter) {
REQUIRE(ISC_STATS_VALID(stats));
REQUIRE(counter < stats->ncounters);
incrementcounter(stats, (int)counter);
atomic_fetch_add_explicit(&stats->counters[counter], 1,
memory_order_relaxed);
}
void
@@ -198,7 +187,8 @@ isc_stats_decrement(isc_stats_t *stats, isc_statscounter_t counter) {
REQUIRE(ISC_STATS_VALID(stats));
REQUIRE(counter < stats->ncounters);
decrementcounter(stats, (int)counter);
atomic_fetch_sub_explicit(&stats->counters[counter], 1,
memory_order_relaxed);
}
void