* tables of power of two in size are used, collisions are handled by
* chaining. See the source code for more information... :)
*
- * Copyright (c) 2006-2009, Salvatore Sanfilippo <antirez at gmail dot com>
+ * Copyright (c) 2006-2010, Salvatore Sanfilippo <antirez at gmail dot com>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
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;
} 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) \
/* 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);