X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/ed9b544e10b84cd43348ddfab7068b610a5df1f7..eb6845621cff10d890769fc785fd1c50ab7bd164:/dict.h diff --git a/dict.h b/dict.h index ae634b49..bd935d5f 100644 --- a/dict.h +++ b/dict.h @@ -60,9 +60,9 @@ typedef struct dictType { typedef struct dict { dictEntry **table; dictType *type; - unsigned int size; - unsigned int sizemask; - unsigned int used; + unsigned long size; + unsigned long sizemask; + unsigned long used; void *privdata; } dict; @@ -73,7 +73,7 @@ typedef struct dictIterator { } dictIterator; /* This is the initial size of every hash table */ -#define DICT_HT_INITIAL_SIZE 16 +#define DICT_HT_INITIAL_SIZE 4 /* ------------------------------- Macros ------------------------------------*/ #define dictFreeEntryVal(ht, entry) \ @@ -107,12 +107,12 @@ typedef struct dictIterator { #define dictGetEntryKey(he) ((he)->key) #define dictGetEntryVal(he) ((he)->val) -#define dictGetHashTableSize(ht) ((ht)->size) -#define dictGetHashTableUsed(ht) ((ht)->used) +#define dictSlots(ht) ((ht)->size) +#define dictSize(ht) ((ht)->used) /* API */ dict *dictCreate(dictType *type, void *privDataPtr); -int dictExpand(dict *ht, unsigned int size); +int dictExpand(dict *ht, unsigned long size); int dictAdd(dict *ht, void *key, void *val); int dictReplace(dict *ht, void *key, void *val); int dictDelete(dict *ht, const void *key);