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 · 213 阅读 · 0 评论 -
atomicvar.h
1原创 2020-05-17 19:32:52 · 342 阅读 · 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 · 238 阅读 · 0 评论 -
ziplist
版本6.0.1 ziplist.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 · 160 阅读 · 0 评论