From f7dab3e92515e3254560e696b91f7d0eb526f0f6 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Fri, 9 Nov 2018 19:17:06 -0800 Subject: fixes #782 stat namespace collision on QNX --- src/core/stats.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/core/stats.h') diff --git a/src/core/stats.h b/src/core/stats.h index 152ba01f..87bd90a7 100644 --- a/src/core/stats.h +++ b/src/core/stats.h @@ -29,7 +29,11 @@ typedef void (*nni_stat_update)(nni_stat_item *, void *); typedef enum nng_stat_type_enum nni_stat_type; typedef enum nng_unit_enum nni_stat_unit; -// nni_stat_item is used by providers +// nni_stat_item is used by providers. Providers should avoid accessing +// this directly, but use accessors below. It is important that we offer +// this structure so that providers can declare them inline, in order to +// avoid having to spend dereference costs or (worse) to have to include +// extra conditionals on hot code paths. struct nni_stat_item { #ifdef NNG_ENABLE_STATS nni_list_node si_node; // list node, framework use only @@ -43,7 +47,7 @@ struct nni_stat_item { nni_stat_unit si_unit; // units, e.g. NNG_UNIT_MILLIS nni_stat_update si_update; // update function (can be NULL) const char * si_string; // string value (NULL for numerics) - uint64_t si_value; // numeric value + uint64_t si_number; // numeric value nni_atomic_u64 si_atomic; // atomic value #endif }; -- cgit v1.2.3-70-g09d2