Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
394f6aaf
Commit
394f6aaf
authored
Jan 19, 2023
by
Vitaly Arbuzov
Browse files
Make dictEntry opaque again
parent
742c6750
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/dict.c
View file @
394f6aaf
...
...
@@ -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
;
...
...
src/dict.h
View file @
394f6aaf
...
...
@@ -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
{
...
...
src/object.c
View file @
394f6aaf
...
...
@@ -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 * dictEntry
MemUsage(
) +
dbSlots(db) * sizeof(dictEntry*) +
keyscount * sizeof(robj);
mh->db[mh->num_dbs].overhead_ht_main = mem;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment