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
0517ab83
Commit
0517ab83
authored
Jan 15, 2018
by
zhaozhao.zz
Browse files
lazyfree: fix memory leak for lazyfree-lazy-server-del
parent
238c9bd0
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lazyfree.c
View file @
0517ab83
...
@@ -64,9 +64,10 @@ int dbAsyncDelete(redisDb *db, robj *key) {
...
@@ -64,9 +64,10 @@ int dbAsyncDelete(redisDb *db, robj *key) {
robj
*
val
=
dictGetVal
(
de
);
robj
*
val
=
dictGetVal
(
de
);
size_t
free_effort
=
lazyfreeGetFreeEffort
(
val
);
size_t
free_effort
=
lazyfreeGetFreeEffort
(
val
);
/* If releasing the object is too much work, let's put it into the
/* If releasing the object is too much work and the refcount
* lazy free list. */
* is 1, that means the object really needs to be freed,
if
(
free_effort
>
LAZYFREE_THRESHOLD
)
{
* let's put it into the lazy free list. */
if
(
free_effort
>
LAZYFREE_THRESHOLD
&&
val
->
refcount
==
1
)
{
atomicIncr
(
lazyfree_objects
,
1
);
atomicIncr
(
lazyfree_objects
,
1
);
bioCreateBackgroundJob
(
BIO_LAZY_FREE
,
val
,
NULL
,
NULL
);
bioCreateBackgroundJob
(
BIO_LAZY_FREE
,
val
,
NULL
,
NULL
);
dictSetVal
(
db
->
dict
,
de
,
NULL
);
dictSetVal
(
db
->
dict
,
de
,
NULL
);
...
...
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