redis ziplist 压缩列表加新工作流程
2020-04-07 11:41:00 0 举报
视图主要描述 redis 压缩列表 ziplist ,添加新元素的工作流程。
作者其他创作
大纲/内容
2 bytes
curlen-offset-1+nextdiff
curlen-offset-1+nextdiff
zlbytes
zllen
offset = p-zl;
old prevlen
entry2
zlend
p + reqlen
entry2 prevlen 1 byte
entry1
reqlen 1024 bytes
nextdiff = 4
zltail
new prevlen lensize = 5 bytes
prevlen 1 byte
\"2\"
10 bytes
redis ziplist 压缩列表加新工作流程
curlen
nextdiff
reqlen
wenfh2020.com
insert
(gdb) p p$20 = (unsigned char *) 0x10080060c <incomplete sequence \\366\\377>(gdb) p p + reqlen$21 = (unsigned char *) 0x100800a0f \"\"(gdb) p p - nextdiff $22 = (unsigned char *) 0x100800608 \"\\002\"(gdb) p zl$23 = (unsigned char *) 0x100800600 \"\\026\\004\"(gdb) p curlen-offset-1+nextdiff$24 = 6
p
zl
p - nextdiff
entry2 new prev len
\"5\"
0 条评论
下一页
为你推荐
查看更多