https://github.com/redis/redis/blob/6a9cc20d9429e0ce1d6bfca5a40b681b1665cdec/src/ziplist.c#L114-L121
This specific example above in ziplist.c shows the memory layout and the corresponding field of a ziplist.
However, the third corresponding field name entries in line 120 is confusing. Because its description is exactly the definition of zllen in the previous comment.
- entries description
https://github.com/redis/redis/blob/6a9cc20d9429e0ce1d6bfca5a40b681b1665cdec/src/ziplist.c#L126-L127
- zllen definition
https://github.com/redis/redis/blob/6a9cc20d9429e0ce1d6bfca5a40b681b1665cdec/src/ziplist.c#L29-L31
Therefore, the third corresponding field name should be zllen instead of entries for any precise or consistent reason.
Comment From: sundb
@cacosub7 Thanks, They do not correspond.
BTW, since 7.0 ziplist has been replaced by listpack, generally we don't go back to modify the code or doc of ziplist.
Comment From: enjoy-binbin
BTW, since 7.0 ziplist has been replaced by listpack, generally we don't go back to modify the code or doc of ziplist.
i think it should be fixed, even though it's dead code
Comment From: cacosub7
BTW, since 7.0 ziplist has been replaced by listpack, generally we don't go back to modify the code or doc of ziplist.
i think it should be fixed, even though it's dead code
I've created a pr for it