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
44d4b87f
Commit
44d4b87f
authored
Feb 28, 2011
by
antirez
Browse files
convert the zipmap into hash in rdb loading if the zipmap has too many elements
parent
cebac465
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/rdb.c
View file @
44d4b87f
...
...
@@ -893,7 +893,12 @@ robj *rdbLoadObject(int type, FILE *fp) {
o
->
ptr
=
zmalloc
(
sdslen
(
aux
->
ptr
));
memcpy
(
o
->
ptr
,
aux
->
ptr
,
sdslen
(
aux
->
ptr
));
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
{
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