62

见微知著 —— Redis 字符串内部结构源码分析-Java架构的博客

 5 years ago
source link: http://blog.51cto.com/13732225/2170701
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
前言本篇我们开始讲字典key的内部结构,也就是sds字符串。首先它不是普通字符串,而是sds字符串,这个sds的意思是「SimpleDynamicString」,它的结构很简单,它是动态的,意味着可以支持修改。不过即使是这样简单的字符串结构,在结构设计上作者可是煞费苦心。正文我们知道C语言里面的字符串是以0x\0结尾,通常就说是以NULL结尾。它不包含长度信息,当我们需要获取字符串长度时,需要调用

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK