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
b9491b65
Commit
b9491b65
authored
Dec 03, 2017
by
zhaozhao.zz
Browse files
quicklist: change the len of quicklist to unsigned long
parent
664bbfe7
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/debug.c
View file @
b9491b65
...
@@ -393,13 +393,13 @@ void debugCommand(client *c) {
...
@@ -393,13 +393,13 @@ void debugCommand(client *c) {
val = dictGetVal(de);
val = dictGetVal(de);
strenc = strEncoding(val->encoding);
strenc = strEncoding(val->encoding);
char extra[1
2
8] = {0};
char extra[1
3
8] = {0};
if (val->encoding == OBJ_ENCODING_QUICKLIST) {
if (val->encoding == OBJ_ENCODING_QUICKLIST) {
char *nextra = extra;
char *nextra = extra;
int remaining = sizeof(extra);
int remaining = sizeof(extra);
quicklist *ql = val->ptr;
quicklist *ql = val->ptr;
/* Add number of quicklist nodes */
/* Add number of quicklist nodes */
int used = snprintf(nextra, remaining, " ql_nodes:%u", ql->len);
int used = snprintf(nextra, remaining, " ql_nodes:%
l
u", ql->len);
nextra += used;
nextra += used;
remaining -= used;
remaining -= used;
/* Add average quicklist fill factor */
/* Add average quicklist fill factor */
...
...
src/quicklist.h
View file @
b9491b65
...
@@ -64,7 +64,7 @@ typedef struct quicklistLZF {
...
@@ -64,7 +64,7 @@ typedef struct quicklistLZF {
char
compressed
[];
char
compressed
[];
}
quicklistLZF
;
}
quicklistLZF
;
/* quicklist is a
32
byte struct (on 64-bit systems) describing a quicklist.
/* quicklist is a
40
byte struct (on 64-bit systems) describing a quicklist.
* 'count' is the number of total entries.
* 'count' is the number of total entries.
* 'len' is the number of quicklist nodes.
* 'len' is the number of quicklist nodes.
* 'compress' is: -1 if compression disabled, otherwise it's the number
* 'compress' is: -1 if compression disabled, otherwise it's the number
...
@@ -74,7 +74,7 @@ typedef struct quicklist {
...
@@ -74,7 +74,7 @@ typedef struct quicklist {
quicklistNode
*
head
;
quicklistNode
*
head
;
quicklistNode
*
tail
;
quicklistNode
*
tail
;
unsigned
long
count
;
/* total count of all entries in all ziplists */
unsigned
long
count
;
/* total count of all entries in all ziplists */
unsigned
int
len
;
/* number of quicklistNodes */
unsigned
long
len
;
/* number of quicklistNodes */
int
fill
:
16
;
/* fill factor for individual nodes */
int
fill
:
16
;
/* fill factor for individual nodes */
unsigned
int
compress
:
16
;
/* depth of end nodes not to compress;0=off */
unsigned
int
compress
:
16
;
/* depth of end nodes not to compress;0=off */
}
quicklist
;
}
quicklist
;
...
...
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