- 博客(2)
- 收藏
- 关注
原创 Redis采用的Hash算法
在Redis中,采用Bernstein的Hash算法,具体代码如下:unsigned int dictGenHashFunction(const unsigned char *buf, int len) { unsigned int hash = 5381; while (len--) hash = ((hash << 5) + hash) + (*buf
2012-01-12 08:12:26 1915
原创 Redis代码分析之核心数据结构
在Redis中核心的数据结构有以下一些:1)dict数据结构:typedef struct dict { dictType *type; void *privdata; dictht ht[2]; int rehashidx; int iterators;} dict;其中:
2012-01-10 17:55:06 743
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人