Convert sb_counter_add() to C99 inline.

This commit is contained in:
Alexey Kopytov
2017-12-01 13:24:47 +03:00
parent f6604291fa
commit 0464dfbddb
2 changed files with 5 additions and 4 deletions

View File

@ -28,8 +28,10 @@
static sb_counters_t last_intermediate_counters;
static sb_counters_t last_cumulative_counters;
extern inline uint64_t sb_counter_val(int thread_id, sb_counter_type_t type);
extern inline void sb_counter_inc(int thread_id, sb_counter_type_t type);
extern inline uint64_t sb_counter_val(int, sb_counter_type_t);
extern inline void sb_counter_add(int, sb_counter_type_t, uint64_t);
extern inline void sb_counter_inc(int, sb_counter_type_t);
/* Initialize per-thread stats */

View File

@ -65,8 +65,7 @@ inline uint64_t sb_counter_val(int thread_id, sb_counter_type_t type)
}
/* Add a given value to a given stat counter for a given thread */
static inline void sb_counter_add(int thread_id, sb_counter_type_t type,
uint64_t val)
inline void sb_counter_add(int thread_id, sb_counter_type_t type, uint64_t val)
{
ck_pr_store_64(&sb_counters[thread_id][type],
sb_counter_val(thread_id, type) + val);