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;
...
@@ -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
;
...
...
src/dict.h
View file @
394f6aaf
...
@@ -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
{
...
...
src/object.c
View file @
394f6aaf
...
@@ -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
*
dictEntry
MemUsage
(
)
+
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
;
...
...
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