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
936c4ab6
Commit
936c4ab6
authored
Jun 02, 2011
by
antirez
Committed by
antirez
Jun 03, 2011
Browse files
touch less pages in decrRefCount
parent
b002546b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/object.c
View file @
936c4ab6
...
@@ -180,7 +180,7 @@ void decrRefCount(void *obj) {
...
@@ -180,7 +180,7 @@ void decrRefCount(void *obj) {
robj
*
o
=
obj
;
robj
*
o
=
obj
;
if
(
o
->
refcount
<=
0
)
redisPanic
(
"decrRefCount against refcount <= 0"
);
if
(
o
->
refcount
<=
0
)
redisPanic
(
"decrRefCount against refcount <= 0"
);
if
(
--
(
o
->
refcount
)
==
0
)
{
if
(
o
->
refcount
==
1
)
{
switch
(
o
->
type
)
{
switch
(
o
->
type
)
{
case
REDIS_STRING
:
freeStringObject
(
o
);
break
;
case
REDIS_STRING
:
freeStringObject
(
o
);
break
;
case
REDIS_LIST
:
freeListObject
(
o
);
break
;
case
REDIS_LIST
:
freeListObject
(
o
);
break
;
...
@@ -189,8 +189,9 @@ void decrRefCount(void *obj) {
...
@@ -189,8 +189,9 @@ void decrRefCount(void *obj) {
case
REDIS_HASH
:
freeHashObject
(
o
);
break
;
case
REDIS_HASH
:
freeHashObject
(
o
);
break
;
default:
redisPanic
(
"Unknown object type"
);
break
;
default:
redisPanic
(
"Unknown object type"
);
break
;
}
}
o
->
ptr
=
NULL
;
/* defensive programming. We'll see NULL in traces. */
zfree
(
o
);
zfree
(
o
);
}
else
{
o
->
refcount
--
;
}
}
}
}
...
...
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