
redis源码分析
_冬木
这个作者很懒,什么都没留下…
展开
-
endianconv.h
/* variants of the function doing the actual conversion only if the target * host is big endian */#if (BYTE_ORDER == LITTLE_ENDIAN)#define memrev16ifbe(p) ((void)(0))#define memrev32ifbe(p) ((void)(0))#define memrev64ifbe(p) ((void)(0))#define intrev原创 2020-05-17 22:57:03 · 260 阅读 · 0 评论 -
atomicvar.h
1原创 2020-05-17 19:32:52 · 403 阅读 · 0 评论 -
zmalloc.c
void *zmalloc(size_t size) { void *ptr = malloc(size+PREFIX_SIZE); if (!ptr) zmalloc_oom_handler(size);#ifdef HAVE_MALLOC_SIZE update_zmalloc_stat_alloc(zmalloc_size(ptr)); return ptr;#else *((size_t*)ptr) = size; update_zmalloc_原创 2020-05-17 16:42:14 · 294 阅读 · 0 评论 -
ziplist
版本6.0.1ziplist.c/* Create a new empty ziplist. */unsigned char *ziplistNew(void) { unsigned int bytes = ZIPLIST_HEADER_SIZE+ZIPLIST_END_SIZE; unsigned char *zl = zmalloc(bytes); // 分配bytes个字节的内存 ZIPLIST_BYTES(zl) = intrev32ifbe(bytes); Z原创 2020-05-17 16:40:13 · 190 阅读 · 0 评论