Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
c45366be
Commit
c45366be
authored
Jan 15, 2018
by
antirez
Browse files
Put more details in the comment introduced by #4601.
parent
1ed5ac7c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lazyfree.c
View file @
c45366be
...
@@ -64,9 +64,14 @@ int dbAsyncDelete(redisDb *db, robj *key) {
...
@@ -64,9 +64,14 @@ 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 and the refcount
/* If releasing the object is too much work, do it in the background
* is 1, that means the object really needs to be freed,
* by adding the object to the lazy free list.
* let's put it into the lazy free list. */
* Note that if the object is shared, to reclaim it now it is not
* possible. This rarely happens, however sometimes the implementation
* of parts of the Redis core may call incrRefCount() to protect
* objects, and then call dbDelete(). In this case we'll fall
* through and reach the dictFreeUnlinkedEntry() call, that will be
* equivalent to just calling decrRefCount(). */
if
(
free_effort
>
LAZYFREE_THRESHOLD
&&
val
->
refcount
==
1
)
{
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
);
...
...
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