diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-11-09 19:17:06 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-11-09 19:17:06 -0800 |
| commit | f7dab3e92515e3254560e696b91f7d0eb526f0f6 (patch) | |
| tree | cfd1b7c8e1b61ad974457d33e7b80d4a370fbe61 /src/core/stats.h | |
| parent | 46a383a1d27dee6052936fd80f565e06afdf6aac (diff) | |
| download | nng-f7dab3e92515e3254560e696b91f7d0eb526f0f6.tar.gz nng-f7dab3e92515e3254560e696b91f7d0eb526f0f6.tar.bz2 nng-f7dab3e92515e3254560e696b91f7d0eb526f0f6.zip | |
fixes #782 stat namespace collision on QNX
Diffstat (limited to 'src/core/stats.h')
| -rw-r--r-- | src/core/stats.h | 8 |
1 files changed, 6 insertions, 2 deletions
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 }; |
