"vscode:/vscode.git/clone" did not exist on "35a8302b7cbdf7ad59256f53f4e9704f3d256198"
Commit 064d5c96 authored by antirez's avatar antirez
Browse files

Use long for rehash and iterator index in dict.h.

This allows to support datasets with more than 2 billion of keys
(possible in very large memory instances, this bug was actually
reported).

Closes issue #1814.
parent 293348d0
......@@ -77,7 +77,7 @@ typedef struct dict {
dictType *type;
void *privdata;
dictht ht[2];
int rehashidx; /* rehashing not in progress if rehashidx == -1 */
long rehashidx; /* rehashing not in progress if rehashidx == -1 */
int iterators; /* number of iterators currently running */
} dict;
......@@ -87,9 +87,11 @@ typedef struct dict {
* should be called while iterating. */
typedef struct dictIterator {
dict *d;
int table, index, safe;
long index;
int table, safe;
dictEntry *entry, *nextEntry;
long long fingerprint; /* unsafe iterator fingerprint for misuse detection */
/* unsafe iterator fingerprint for misuse detection. */
long long fingerprint;
} dictIterator;
typedef void (dictScanFunction)(void *privdata, const dictEntry *de);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment