redis中动态字符串sds相关的文件为:sds.h与sds.c 一.数据结构 redis中定义了自己的数据类型"sds",用于描述 char*,与一些数据结构 typedef char *sds; /* Note: sdshdr5 is never used, we just access the flags byte directly. * However is here to document the layout of type 5 SDS strings. */ struct…
上一篇文章已经介绍了MemoryCache,MemoryCache存储的数据类型是Object,也说了Redis支持五中数据类型的存储,但是微软的Redis缓存组件只实现了Hash类型的存储.在分析源码之前,先学几个关于Redis操作的命令. 一.Redis命令 Redis所有的命令在http://doc.redisfans.com/上有详细介绍.下面介绍几个常用的关于Hash类型的命令. HSET:用于添加缓存 用法:HSET key field value . 返回值:如果 field 是哈…