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;
static unsigned int dict_force_resize_ratio = 5;
/* -------------------------- types ----------------------------------------- */
struct dictEntry {
typedef struct dictEntry {
void *key;
union {
void *val;
......@@ -70,10 +69,7 @@ struct dictEntry {
double d;
} v;
struct dictEntry *next; /* Next entry in the same hash bucket. */
void *metadata[]; /* An arbitrary number of bytes (starting at a
* pointer-aligned address) of size as returned
* by dictType's dictEntryMetadataBytes(). */
};
} dictEntry;
typedef struct {
void *key;
......
......@@ -44,17 +44,7 @@
#define DICT_OK 0
#define DICT_ERR 1
typedef struct dictEntry {
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 dictEntry dictEntry; /* opaque */
typedef struct dict dict;
typedef struct dictType {
......
......@@ -1236,14 +1236,14 @@ struct redisMemOverhead *getMemoryOverheadData(void) {
for (j = 0; j < server.dbnum; j++) {
redisDb *db = server.db+j;
long long keyscount = dbSize(db);
unsigned long long keyscount = dbSize(db);
if (keyscount==0) continue;
mh->total_keys += keyscount;
mh->db = zrealloc(mh->db,sizeof(mh->db[0])*(mh->num_dbs+1));
mh->db[mh->num_dbs].dbid = j;
mem = keyscount * sizeof(dictEntry) +
mem = keyscount * dictEntryMemUsage() +
dbSlots(db) * sizeof(dictEntry*) +
keyscount * sizeof(robj);
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