标签:提高 建立 对象 插入 频道 strong 取出 位置 多少
Redis是一个开源的使用ANSI C语言编写、支持网络、可基于内存亦可持久化的日志型、Key-Value数据库,并提供多种语言的API。从2010年3月15日起,Redis的开发工作由VMware主持。从2013年5月开始,Redis的开发由Pivotal赞助。
|
1
2
3
4
5
6
|
typedefchar*sds;structsdshdr{longlen;longfree;charbuf[];}; |
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
//list迭代器typedefstructlistIter{listNode*next;intdirection;}listIter;//list数据结构typedefstructlist{listNode*head;listNode*tail;void*(*dup)(void*ptr);void(*free)(void*ptr);int(*match)(void*ptr,void*key);unsignedintlen;listIteriter;}list; |
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
//dict中的元素项typedefstructdictEntry{void*key;void*val;structdictEntry*next;}dictEntry;//dict相关配置函数typedefstructdictType{unsignedint(*hashFunction)(constvoid*key);void*(*keyDup)(void*privdata,constvoid*key);void*(*valDup)(void*privdata,constvoid*obj);int(*keyCompare)(void*privdata,constvoid*key1,constvoid*key2);void(*keyDestructor)(void*privdata,void*key);void(*valDestructor)(void*privdata,void*obj);}dictType;//dict定义typedefstructdict{dictEntry**table;dictType*type;unsignedlongsize;unsignedlongsizemask;unsignedlongused;void*privdata;}dict;//dict迭代器typedefstructdictIterator{dict*ht;intindex;dictEntry*entry,*nextEntry;}dictIterator; |
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
typedefstructzskiplistNode{structzskiplistNode**forward;structzskiplistNode*backward;doublescore;robj*obj;}zskiplistNode;typedefstructzskiplist{structzskiplistNode*header,*tail;unsignedlonglength;intlevel;}zskiplist;typedefstructzset{dict*dict;zskiplist*zsl;}zset; |
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
daemonizeyespidfile/usr/local/redis/var/redis.pidport6379timeout300logleveldebuglogfile/usr/local/redis/var/redis.logdatabases16save9001save30010save6010000rdbcompressionyesdbfilenamedump.rdbdir/usr/local/redis/var/appendonlynoappendfsyncalwaysglueoutputbufyesshareobjectsnoshareobjectspoolsize1024 |
标签:提高 建立 对象 插入 频道 strong 取出 位置 多少
原文地址:http://www.cnblogs.com/wangnengwu/p/7383102.html