/* A redis object, that is a type able to hold a string / list / set */
typedef struct redisObject {
- int type;
void *ptr;
+ int type;
int refcount;
} robj;
int cronloops; /* number of times the cron function run */
list *objfreelist; /* A list of freed objects to avoid malloc() */
time_t lastsave; /* Unix time of last save succeeede */
- int usedmemory; /* Used memory in megabytes */
+ size_t usedmemory; /* Used memory in megabytes */
/* Fields used only for stats */
time_t stat_starttime; /* server start time */
long long stat_numcommands; /* number of processed commands */
/* Show information about connected clients */
if (!(loops % 5)) {
- redisLog(REDIS_DEBUG,"%d clients connected (%d slaves), %d bytes in use",
+ redisLog(REDIS_DEBUG,"%d clients connected (%d slaves), %zu bytes in use",
listLength(server.clients)-listLength(server.slaves),
listLength(server.slaves),
server.usedmemory,
while(1) {
de = dictGetRandomKey(c->db->dict);
- if (expireIfNeeded(c->db,dictGetEntryKey(de)) == 0) break;
+ if (!de || expireIfNeeded(c->db,dictGetEntryKey(de)) == 0) break;
}
if (de == NULL) {
+ addReply(c,shared.plus);
addReply(c,shared.crlf);
} else {
addReply(c,shared.plus);
"redis_version:%s\r\n"
"connected_clients:%d\r\n"
"connected_slaves:%d\r\n"
- "used_memory:%d\r\n"
+ "used_memory:%zu\r\n"
"changes_since_last_save:%lld\r\n"
"last_save_time:%d\r\n"
"total_connections_received:%lld\r\n"