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
f8956ed6
Commit
f8956ed6
authored
Feb 28, 2011
by
antirez
Browse files
convert the zipmap into hash in rdb loading if the zipmap has too many elements
parent
4d60dea8
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/rdb.c
View file @
f8956ed6
...
@@ -838,7 +838,12 @@ robj *rdbLoadObject(int type, FILE *fp) {
...
@@ -838,7 +838,12 @@ robj *rdbLoadObject(int type, FILE *fp) {
o
->
ptr
=
zmalloc
(
sdslen
(
aux
->
ptr
));
o
->
ptr
=
zmalloc
(
sdslen
(
aux
->
ptr
));
memcpy
(
o
->
ptr
,
aux
->
ptr
,
sdslen
(
aux
->
ptr
));
memcpy
(
o
->
ptr
,
aux
->
ptr
,
sdslen
(
aux
->
ptr
));
decrRefCount
(
aux
);
decrRefCount
(
aux
);
/* FIXME: conver the object if needed */
/* Convert to real hash if the number of items is too large.
* We don't check the max item size as this requires an O(N)
* scan usually. */
if
(
zipmapLen
(
o
->
ptr
)
>
server
.
hash_max_zipmap_entries
)
{
convertToRealHash
(
o
);
}
}
else
{
}
else
{
redisPanic
(
"Unknown object type"
);
redisPanic
(
"Unknown object 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