Object approximated LRU algorithm enhanced / fixed / refactored. This is used for the VM currently but will soon be used for maxmemory expiring.

This commit is contained in:
antirez
2010-10-14 13:52:58 +02:00
parent b4f2e412d0
commit ef59a8bc9e
6 changed files with 41 additions and 23 deletions

View File

@ -211,6 +211,7 @@ void _redisPanic(char *msg, char *file, int line);
/* 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 */
typedef struct redisObject {
unsigned type:4;
unsigned storage:2; /* REDIS_VM_MEMORY or REDIS_VM_SWAPPING */
@ -678,6 +679,7 @@ int getLongLongFromObject(robj *o, long long *target);
char *strEncoding(int encoding);
int compareStringObjects(robj *a, robj *b);
int equalStringObjects(robj *a, robj *b);
unsigned long estimateObjectIdleTime(robj *o);
/* Replication */
void replicationFeedSlaves(list *slaves, int dictid, robj **argv, int argc);