From 4b9ac6edd0ce5382e9f2c07e0c68b3230226df72 Mon Sep 17 00:00:00 2001 From: zhanghailei Date: Mon, 23 Dec 2013 12:32:57 +0800 Subject: [PATCH 1/3] According to context,the size should be 16 rather than 64 --- src/dict.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dict.c b/src/dict.c index 17a32287..bcf592e4 100644 --- a/src/dict.c +++ b/src/dict.c @@ -695,7 +695,7 @@ static unsigned long rev(unsigned long v) { * (where SIZE-1 is always the mask that is equivalent to taking the rest * of the division between the Hash of the key and SIZE). * - * For example if the current hash table size is 64, the mask is + * For example if the current hash table size is 16, the mask is * (in binary) 1111. The position of a key in the hash table will be always * the last four bits of the hash output, and so forth. * From c0f86654142b47e2275fc84eacc08a5e680d7929 Mon Sep 17 00:00:00 2001 From: zhanghailei Date: Thu, 26 Dec 2013 11:28:34 +0800 Subject: [PATCH 2/3] FIXED a typo more thank should be more than --- src/dict.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dict.c b/src/dict.c index bcf592e4..10e42eab 100644 --- a/src/dict.c +++ b/src/dict.c @@ -239,7 +239,7 @@ int dictExpand(dict *d, unsigned long size) /* Performs N steps of incremental rehashing. Returns 1 if there are still * keys to move from the old to the new hash table, otherwise 0 is returned. * Note that a rehashing step consists in moving a bucket (that may have more - * thank one key as we use chaining) from the old to the new hash table. */ + * than one key as we use chaining) from the old to the new hash table. */ int dictRehash(dict *d, int n) { if (!dictIsRehashing(d)) return 0; From 138695d9908bf9e35875a6e29f24c87a202b1fe4 Mon Sep 17 00:00:00 2001 From: zhanghailei Date: Tue, 4 Mar 2014 12:20:31 +0800 Subject: [PATCH 3/3] refer to updateLRUClock's comment REDIS_LRU_CLOCK_MAX is 22 bits,but #define REDIS_LRU_CLOCK_MAX ((1<<21)-1) only 21 bits --- src/redis.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/redis.h b/src/redis.h index c09d410e..0348421f 100644 --- a/src/redis.h +++ b/src/redis.h @@ -382,7 +382,7 @@ typedef long long mstime_t; /* millisecond time type. */ /* A redis object, that is a type able to hold a string / list / set */ /* The actual Redis Object */ -#define REDIS_LRU_CLOCK_MAX ((1<<21)-1) /* Max value of obj->lru */ +#define REDIS_LRU_CLOCK_MAX ((1<<22)-1) /* Max value of obj->lru */ #define REDIS_LRU_CLOCK_RESOLUTION 10 /* LRU clock resolution in seconds */ typedef struct redisObject { unsigned type:4;