Commit 394f6aaf authored by Vitaly Arbuzov's avatar Vitaly Arbuzov
Browse files

Make dictEntry opaque again

parent 742c6750
...@@ -60,8 +60,7 @@ static dictResizeEnable dict_can_resize = DICT_RESIZE_ENABLE; ...@@ -60,8 +60,7 @@ static dictResizeEnable dict_can_resize = DICT_RESIZE_ENABLE;
static unsigned int dict_force_resize_ratio = 5; static unsigned int dict_force_resize_ratio = 5;
/* -------------------------- types ----------------------------------------- */ /* -------------------------- types ----------------------------------------- */
typedef struct dictEntry {
struct dictEntry {
void *key; void *key;
union { union {
void *val; void *val;
...@@ -70,10 +69,7 @@ struct dictEntry { ...@@ -70,10 +69,7 @@ struct dictEntry {
double d; double d;
} v; } v;
struct dictEntry *next; /* Next entry in the same hash bucket. */ struct dictEntry *next; /* Next entry in the same hash bucket. */
void *metadata[]; /* An arbitrary number of bytes (starting at a } dictEntry;
* pointer-aligned address) of size as returned
* by dictType's dictEntryMetadataBytes(). */
};
typedef struct { typedef struct {
void *key; void *key;
......
...@@ -44,17 +44,7 @@ ...@@ -44,17 +44,7 @@
#define DICT_OK 0 #define DICT_OK 0
#define DICT_ERR 1 #define DICT_ERR 1
typedef struct dictEntry { typedef struct dictEntry dictEntry; /* opaque */
void *key;
union {
void *val;
uint64_t u64;
int64_t s64;
double d;
} v;
struct dictEntry *next; /* Next entry in the same hash bucket. */
} dictEntry;
typedef struct dict dict; typedef struct dict dict;
typedef struct dictType { typedef struct dictType {
......
...@@ -1236,14 +1236,14 @@ struct redisMemOverhead *getMemoryOverheadData(void) { ...@@ -1236,14 +1236,14 @@ struct redisMemOverhead *getMemoryOverheadData(void) {
for (j = 0; j < server.dbnum; j++) { for (j = 0; j < server.dbnum; j++) {
redisDb *db = server.db+j; redisDb *db = server.db+j;
long long keyscount = dbSize(db); unsigned long long keyscount = dbSize(db);
if (keyscount==0) continue; if (keyscount==0) continue;
mh->total_keys += keyscount; mh->total_keys += keyscount;
mh->db = zrealloc(mh->db,sizeof(mh->db[0])*(mh->num_dbs+1)); mh->db = zrealloc(mh->db,sizeof(mh->db[0])*(mh->num_dbs+1));
mh->db[mh->num_dbs].dbid = j; mh->db[mh->num_dbs].dbid = j;
mem = keyscount * sizeof(dictEntry) + mem = keyscount * dictEntryMemUsage() +
dbSlots(db) * sizeof(dictEntry*) + dbSlots(db) * sizeof(dictEntry*) +
keyscount * sizeof(robj); keyscount * sizeof(robj);
mh->db[mh->num_dbs].overhead_ht_main = mem; mh->db[mh->num_dbs].overhead_ht_main = mem;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment