Redis源码阅读 动态字符串实现
源码链接:https://github.com/redis/redis
一、sds.h
redis实现动态字符串的方法是定义一个结构体分别指明字符串长度、分配长度、类型和字符数组,其中类型用来表示不同长度的结构,如下:
/* Note: sdshdr5 is never used, we just access the flags byte directly.
* However is here to document the layout of type 5 SDS strings. */..
原创
2021-09-04 22:03:25 ·
183 阅读 ·
0 评论