summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzhaozhao.zz <zhaozhao.zz@alibaba-inc.com>2017-10-13 11:09:48 +0800
committerantirez <antirez@gmail.com>2017-11-30 13:13:56 +0100
commit22969a13a0c58fc43ca6e598c298470d8450ce44 (patch)
tree094220cf5fe28a5ef390ad31e375ff136309887f
parent6b71f714bdd20983546cbac2b857be7df69c82de (diff)
downloadredis-22969a13a0c58fc43ca6e598c298470d8450ce44.tar.gz
LFU: change lfu* parameters to int
-rw-r--r--src/evict.c2
-rw-r--r--src/server.h4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/evict.c b/src/evict.c
index 5ce5ca07f..0a04ed1bb 100644
--- a/src/evict.c
+++ b/src/evict.c
@@ -334,7 +334,7 @@ uint8_t LFULogIncr(uint8_t counter) {
unsigned long LFUDecrAndReturn(robj *o) {
unsigned long ldt = o->lru >> 8;
unsigned long counter = o->lru & 255;
- if (LFUTimeElapsed(ldt) >= server.lfu_decay_time && counter) {
+ if (LFUTimeElapsed(ldt) >= (unsigned long)server.lfu_decay_time && counter) {
if (counter > LFU_INIT_VAL*2) {
counter /= 2;
if (counter < LFU_INIT_VAL*2) counter = LFU_INIT_VAL*2;
diff --git a/src/server.h b/src/server.h
index e3b56075a..aa04344cb 100644
--- a/src/server.h
+++ b/src/server.h
@@ -1118,8 +1118,8 @@ struct redisServer {
unsigned long long maxmemory; /* Max number of memory bytes to use */
int maxmemory_policy; /* Policy for key eviction */
int maxmemory_samples; /* Pricision of random sampling */
- unsigned int lfu_log_factor; /* LFU logarithmic counter factor. */
- unsigned int lfu_decay_time; /* LFU counter decay factor. */
+ int lfu_log_factor; /* LFU logarithmic counter factor. */
+ int lfu_decay_time; /* LFU counter decay factor. */
/* Blocked clients */
unsigned int bpop_blocked_clients; /* Number of clients blocked by lists */
list *unblocked_clients; /* list of clients to unblock before next loop */