summaryrefslogtreecommitdiff
path: root/src/dict.h
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2011-11-08 19:41:29 +0100
committerantirez <antirez@gmail.com>2011-11-08 19:41:29 +0100
commitaa9a61ccd7cc1ffa1441ef74edd9d51954fc7896 (patch)
tree115ebd6e10bf805a80e75f61891fb93e73270078 /src/dict.h
parentc0ba9ebe13865189a3b21f7be8a910e349b59fda (diff)
downloadredis-aa9a61ccd7cc1ffa1441ef74edd9d51954fc7896.tar.gz
dict.c: added macros in dict.h to set signed and unsigned 64 bit values directly inside the hash entry without using additional memory.
Diffstat (limited to 'src/dict.h')
-rw-r--r--src/dict.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/dict.h b/src/dict.h
index af485e2cd..b907a91f4 100644
--- a/src/dict.h
+++ b/src/dict.h
@@ -105,6 +105,12 @@ typedef struct dictIterator {
entry->v.val = (_val_); \
} while(0)
+#define dictSetSignedIntegerVal(d, entry, _val_) \
+ do { entry->v.i64 = _val_; } while(0)
+
+#define dictSetUnsignedIntegerVal(d, entry, _val_) \
+ do { entry->v.u64 = _val_; } while(0)
+
#define dictFreeKey(d, entry) \
if ((d)->type->keyDestructor) \
(d)->type->keyDestructor((d)->privdata, (entry)->key)