跳转到内容

Notes of Redis Design

struct sdshdr {
int len;
int free;
char buf[];
}

Uses len instead of \0 to judge the endig of a string.

typedef struct listNode {
struct listNode* prev;
struct listNode* next;
void* value;
}listNode;
typedef struct list{
listNode* head;
listNode* tail;
unsigned long len;
void *(*dup) (void* ptr);
void *(*free) (void* ptr);
int *(*match) (void* ptr);
}list;