Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
813960db
Commit
813960db
authored
Feb 23, 2018
by
antirez
Browse files
Fix ziplist prevlen encoding description. See #4705.
parent
ffde73c5
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/ziplist.c
View file @
813960db
...
...
@@ -53,20 +53,20 @@
* <prevlen> <encoding>
*
* The length of the previous entry, <prevlen>, is encoded in the following way:
* If this length is smaller than 25
5
bytes, it will only consume a single
* If this length is smaller than 25
4
bytes, it will only consume a single
* byte representing the length as an unsinged 8 bit integer. When the length
* is greater than or equal to 25
5
, it will consume 5 bytes. The first byte is
* set to 25
5
(F
F
) to indicate a larger value is following. The remaining 4
* is greater than or equal to 25
4
, it will consume 5 bytes. The first byte is
* set to 25
4
(F
E
) to indicate a larger value is following. The remaining 4
* bytes take the length of the previous entry as value.
*
* So practically an entry is encoded in the following way:
*
* <prevlen from 0 to 25
4
> <encoding> <entry>
* <prevlen from 0 to 25
3
> <encoding> <entry>
*
* Or alternatively if the previous entry length is greater than 25
4
bytes
* Or alternatively if the previous entry length is greater than 25
3
bytes
* the following encoding is used:
*
* 0xF
F
<4 bytes unsigned little endian prevlen> <encoding> <entry>
* 0xF
E
<4 bytes unsigned little endian prevlen> <encoding> <entry>
*
* The encoding field of the entry depends on the content of the
* entry. When the entry is a string, the first 2 bits of the encoding first
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment