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
38192079
Commit
38192079
authored
Mar 28, 2010
by
Pieter Noordhuis
Browse files
removed references in code to ZIPMAP_EMPTY
parent
9e071b4b
Changes
1
Hide whitespace changes
Inline
Side-by-side
zipmap.c
View file @
38192079
...
...
@@ -87,12 +87,9 @@
#include <assert.h>
#include "zmalloc.h"
#define ZIPMAP_BIGLEN 253
#define ZIPMAP_EMPTY 254
#define ZIPMAP_BIGLEN 254
#define ZIPMAP_END 255
#define ZIPMAP_STATUS_FRAGMENTED 1
/* The following defines the max value for the <free> field described in the
* comments above, that is, the max number of trailing bytes in a value. */
#define ZIPMAP_VALUE_MAX_FREE 5
...
...
@@ -142,13 +139,7 @@ static unsigned int zipmapEncodeLength(unsigned char *p, unsigned int len) {
*
* If NULL is returned, and totlen is not NULL, it is set to the entire
* size of the zimap, so that the calling function will be able to
* reallocate the original zipmap to make room for more entries.
*
* If NULL is returned, and freeoff and freelen are not NULL, they are set
* to the offset of the first empty space that can hold '*freelen' bytes
* (freelen is an integer pointer used both to signal the required length
* and to get the reply from the function). If there is not a suitable
* free space block to hold the requested bytes, *freelen is set to 0. */
* reallocate the original zipmap to make room for more entries. */
static
unsigned
char
*
zipmapLookupRaw
(
unsigned
char
*
zm
,
unsigned
char
*
key
,
unsigned
int
klen
,
unsigned
int
*
totlen
)
{
unsigned
char
*
p
=
zm
+
1
,
*
k
=
NULL
;
unsigned
int
l
;
...
...
@@ -325,8 +316,6 @@ unsigned char *zipmapRewind(unsigned char *zm) {
* }
*/
unsigned
char
*
zipmapNext
(
unsigned
char
*
zm
,
unsigned
char
**
key
,
unsigned
int
*
klen
,
unsigned
char
**
value
,
unsigned
int
*
vlen
)
{
while
(
zm
[
0
]
==
ZIPMAP_EMPTY
)
zm
+=
zipmapDecodeLength
(
zm
+
1
);
if
(
zm
[
0
]
==
ZIPMAP_END
)
return
NULL
;
if
(
key
)
{
*
key
=
zm
;
...
...
@@ -383,10 +372,6 @@ void zipmapRepr(unsigned char *p) {
if
(
p
[
0
]
==
ZIPMAP_END
)
{
printf
(
"{end}"
);
break
;
}
else
if
(
p
[
0
]
==
ZIPMAP_EMPTY
)
{
l
=
zipmapDecodeLength
(
p
+
1
);
printf
(
"{%u empty block}"
,
l
);
p
+=
l
;
}
else
{
unsigned
char
e
;
...
...
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