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
f899c31f
Unverified
Commit
f899c31f
authored
Jul 31, 2019
by
Salvatore Sanfilippo
Committed by
GitHub
Jul 31, 2019
Browse files
Merge pull request #6261 from chendq8/robj
make memory usage consistent of robj with OBJ_ENCODING_INT
parents
fc5c2052
004c26ec
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/object.c
View file @
f899c31f
...
...
@@ -467,10 +467,15 @@ robj *tryObjectEncoding(robj *o) {
incrRefCount
(
shared
.
integers
[
value
]);
return
shared
.
integers
[
value
];
}
else
{
if
(
o
->
encoding
==
OBJ_ENCODING_RAW
)
sdsfree
(
o
->
ptr
);
o
->
encoding
=
OBJ_ENCODING_INT
;
o
->
ptr
=
(
void
*
)
value
;
return
o
;
if
(
o
->
encoding
==
OBJ_ENCODING_RAW
)
{
sdsfree
(
o
->
ptr
);
o
->
encoding
=
OBJ_ENCODING_INT
;
o
->
ptr
=
(
void
*
)
value
;
return
o
;
}
else
{
decrRefCount
(
o
);
return
createStringObjectFromLongLongForValue
(
value
);
}
}
}
...
...
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