mirror of
https://github.com/fluencelabs/redis
synced 2025-03-20 09:30:55 +00:00
Merge pull request #4506 from soloestoy/quicklist-int-problem
Quicklist int problem
This commit is contained in:
commit
e6c3bcf9e0
@ -393,13 +393,13 @@ void debugCommand(client *c) {
|
|||||||
val = dictGetVal(de);
|
val = dictGetVal(de);
|
||||||
strenc = strEncoding(val->encoding);
|
strenc = strEncoding(val->encoding);
|
||||||
|
|
||||||
char extra[128] = {0};
|
char extra[138] = {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:%lu", ql->len);
|
||||||
nextra += used;
|
nextra += used;
|
||||||
remaining -= used;
|
remaining -= used;
|
||||||
/* Add average quicklist fill factor */
|
/* Add average quicklist fill factor */
|
||||||
|
@ -149,7 +149,7 @@ REDIS_STATIC quicklistNode *quicklistCreateNode(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Return cached quicklist count */
|
/* Return cached quicklist count */
|
||||||
unsigned int quicklistCount(const quicklist *ql) { return ql->count; }
|
unsigned long quicklistCount(const quicklist *ql) { return ql->count; }
|
||||||
|
|
||||||
/* Free entire quicklist. */
|
/* Free entire quicklist. */
|
||||||
void quicklistRelease(quicklist *quicklist) {
|
void quicklistRelease(quicklist *quicklist) {
|
||||||
|
@ -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 {
|
|||||||
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;
|
||||||
@ -154,7 +154,7 @@ int quicklistPopCustom(quicklist *quicklist, int where, unsigned char **data,
|
|||||||
void *(*saver)(unsigned char *data, unsigned int sz));
|
void *(*saver)(unsigned char *data, unsigned int sz));
|
||||||
int quicklistPop(quicklist *quicklist, int where, unsigned char **data,
|
int quicklistPop(quicklist *quicklist, int where, unsigned char **data,
|
||||||
unsigned int *sz, long long *slong);
|
unsigned int *sz, long long *slong);
|
||||||
unsigned int quicklistCount(const quicklist *ql);
|
unsigned long quicklistCount(const quicklist *ql);
|
||||||
int quicklistCompare(unsigned char *p1, unsigned char *p2, int p2_len);
|
int quicklistCompare(unsigned char *p1, unsigned char *p2, int p2_len);
|
||||||
size_t quicklistGetLzf(const quicklistNode *node, void **data);
|
size_t quicklistGetLzf(const quicklistNode *node, void **data);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user