summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2015-01-08 09:08:55 +0100
committerantirez <antirez@gmail.com>2015-01-08 09:08:55 +0100
commitbfbfd0dda75eddc1242720eb1e8a6bdad57f7fe7 (patch)
treea367f3076d0d3db4c6af546bc01100c5ba3faaa0
parentdee2318469e0de308a0a3b0e475bbeab47c40fcb (diff)
downloadredis-rdbchanges.tar.gz
A few more AUX info fields added to RDB.rdbchanges
-rw-r--r--src/rdb.c5
1 files changed, 5 insertions, 0 deletions
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;
}