From bfbfd0dda75eddc1242720eb1e8a6bdad57f7fe7 Mon Sep 17 00:00:00 2001 From: antirez Date: Thu, 8 Jan 2015 09:08:55 +0100 Subject: A few more AUX info fields added to RDB. --- src/rdb.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/rdb.c b/src/rdb.c index 23dc89833..6bfa00390 100644 --- a/src/rdb.c +++ b/src/rdb.c @@ -705,8 +705,13 @@ int rdbSaveAuxFieldStrInt(rio *rdb, char *key, long long val) { /* Save a few default AUX fields with information about the RDB generated. */ int rdbSaveInfoAuxFields(rio *rdb) { + int redis_bits = (sizeof(void*) == 8) ? 64 : 32; + + /* Add a few fiels about the state when the RDB was created. */ if (rdbSaveAuxFieldStrStr(rdb,"redis-ver",REDIS_VERSION) == -1) return -1; + if (rdbSaveAuxFieldStrInt(rdb,"redis-bits",redis_bits) == -1) return -1; if (rdbSaveAuxFieldStrInt(rdb,"ctime",time(NULL)) == -1) return -1; + if (rdbSaveAuxFieldStrInt(rdb,"used-mem",zmalloc_used_memory()) == -1) return -1; return 1; } -- cgit v1.2.1