数据结构-SDS
// 空间占用为3B + 字符串长度
struct __attribute__ ((__packed__)) sdshdr8 {
uint8_t len; /* 已使用的长度 used */
uint8_t alloc; /* 分配的总长 excluding the header and null terminator */
unsigned char flags; /* 3 lsb of type, 5 unused bits */
char buf[];
};SDS 的编码
Append 函数的实现
Last updated