summaryrefslogtreecommitdiffstats
path: root/src/libnetdata/dictionary/dictionary.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/libnetdata/dictionary/dictionary.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libnetdata/dictionary/dictionary.h b/src/libnetdata/dictionary/dictionary.h
index 231fbfeb..3d041018 100644
--- a/src/libnetdata/dictionary/dictionary.h
+++ b/src/libnetdata/dictionary/dictionary.h
@@ -59,7 +59,7 @@ typedef enum __attribute__((packed)) dictionary_options {
DICT_OPTION_ADD_IN_FRONT = (1 << 4), // add dictionary items at the front of the linked list (default: at the end)
DICT_OPTION_FIXED_SIZE = (1 << 5), // the items of the dictionary have a fixed size
DICT_OPTION_INDEX_JUDY = (1 << 6), // the default, if no other indexing is set
- DICT_OPTION_INDEX_HASHTABLE = (1 << 7), // use SIMPLE_HASHTABLE for indexing
+// DICT_OPTION_INDEX_HASHTABLE = (1 << 7), // use SIMPLE_HASHTABLE for indexing
} DICT_OPTIONS;
struct dictionary_stats {
@@ -299,7 +299,8 @@ typedef DICTFE_CONST struct dictionary_foreach {
#define dfe_start_rw(dict, value, mode) \
do { \
- DICTFE value ## _dfe = {}; \
+ /* automatically cleanup DFE, to allow using return from within the loop */ \
+ DICTFE _cleanup_(dictionary_foreach_done) value ## _dfe = {}; \
(void)(value); /* needed to avoid warning when looping without using this */ \
for((value) = dictionary_foreach_start_rw(&value ## _dfe, (dict), (mode)); \
(value ## _dfe.item) || (value) ; \
@@ -308,7 +309,6 @@ typedef DICTFE_CONST struct dictionary_foreach {
#define dfe_done(value) \
} \
- dictionary_foreach_done(&value ## _dfe); \
} while(0)
#define dfe_unlock(value) dictionary_foreach_unlock(&value ## _dfe)