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
5705cec6
Unverified
Commit
5705cec6
authored
Aug 10, 2021
by
sundb
Committed by
GitHub
Aug 10, 2021
Browse files
Fix missing dismiss hash listpack memory due to ziplist->listpack migration (#9353)
parent
82528d26
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/object.c
View file @
5705cec6
...
@@ -422,6 +422,8 @@ void dismissListObject(robj *o, size_t size_hint) {
...
@@ -422,6 +422,8 @@ void dismissListObject(robj *o, size_t size_hint) {
node
=
node
->
next
;
node
=
node
->
next
;
}
}
}
}
}
else
{
serverPanic
(
"Unknown list encoding type"
);
}
}
}
}
...
@@ -446,6 +448,8 @@ void dismissSetObject(robj *o, size_t size_hint) {
...
@@ -446,6 +448,8 @@ void dismissSetObject(robj *o, size_t size_hint) {
dismissMemory
(
set
->
ht_table
[
1
],
DICTHT_SIZE
(
set
->
ht_size_exp
[
1
])
*
sizeof
(
dictEntry
*
));
dismissMemory
(
set
->
ht_table
[
1
],
DICTHT_SIZE
(
set
->
ht_size_exp
[
1
])
*
sizeof
(
dictEntry
*
));
}
else
if
(
o
->
encoding
==
OBJ_ENCODING_INTSET
)
{
}
else
if
(
o
->
encoding
==
OBJ_ENCODING_INTSET
)
{
dismissMemory
(
o
->
ptr
,
intsetBlobLen
((
intset
*
)
o
->
ptr
));
dismissMemory
(
o
->
ptr
,
intsetBlobLen
((
intset
*
)
o
->
ptr
));
}
else
{
serverPanic
(
"Unknown set encoding type"
);
}
}
}
}
...
@@ -471,6 +475,8 @@ void dismissZsetObject(robj *o, size_t size_hint) {
...
@@ -471,6 +475,8 @@ void dismissZsetObject(robj *o, size_t size_hint) {
dismissMemory
(
d
->
ht_table
[
1
],
DICTHT_SIZE
(
d
->
ht_size_exp
[
1
])
*
sizeof
(
dictEntry
*
));
dismissMemory
(
d
->
ht_table
[
1
],
DICTHT_SIZE
(
d
->
ht_size_exp
[
1
])
*
sizeof
(
dictEntry
*
));
}
else
if
(
o
->
encoding
==
OBJ_ENCODING_ZIPLIST
)
{
}
else
if
(
o
->
encoding
==
OBJ_ENCODING_ZIPLIST
)
{
dismissMemory
(
o
->
ptr
,
ziplistBlobLen
((
unsigned
char
*
)
o
->
ptr
));
dismissMemory
(
o
->
ptr
,
ziplistBlobLen
((
unsigned
char
*
)
o
->
ptr
));
}
else
{
serverPanic
(
"Unknown zset encoding type"
);
}
}
}
}
...
@@ -495,8 +501,10 @@ void dismissHashObject(robj *o, size_t size_hint) {
...
@@ -495,8 +501,10 @@ void dismissHashObject(robj *o, size_t size_hint) {
/* Dismiss hash table memory. */
/* Dismiss hash table memory. */
dismissMemory
(
d
->
ht_table
[
0
],
DICTHT_SIZE
(
d
->
ht_size_exp
[
0
])
*
sizeof
(
dictEntry
*
));
dismissMemory
(
d
->
ht_table
[
0
],
DICTHT_SIZE
(
d
->
ht_size_exp
[
0
])
*
sizeof
(
dictEntry
*
));
dismissMemory
(
d
->
ht_table
[
1
],
DICTHT_SIZE
(
d
->
ht_size_exp
[
1
])
*
sizeof
(
dictEntry
*
));
dismissMemory
(
d
->
ht_table
[
1
],
DICTHT_SIZE
(
d
->
ht_size_exp
[
1
])
*
sizeof
(
dictEntry
*
));
}
else
if
(
o
->
encoding
==
OBJ_ENCODING_ZIPLIST
)
{
}
else
if
(
o
->
encoding
==
OBJ_ENCODING_LISTPACK
)
{
dismissMemory
(
o
->
ptr
,
ziplistBlobLen
((
unsigned
char
*
)
o
->
ptr
));
dismissMemory
(
o
->
ptr
,
lpBytes
((
unsigned
char
*
)
o
->
ptr
));
}
else
{
serverPanic
(
"Unknown hash encoding type"
);
}
}
}
}
...
...
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