-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation request: clarify padding usage in objects #59
Comments
Sorry for the delay in answering. It is a bit hidden, but lines 332-337 of the specs say:
This is meant to say that the number of bytes between the type byte and the begin of the sub value pairs can be up to 8 bytes long, with padding zero bytes if needed. This is the same as for arrays. The rationale behind this is that it should be possible to write a larger velocypack object linearly, even if it is not known a priori how large it is. One can reserve 8 bytes in this case for this area and does not have to move memory down after the fact when it turns out that the object is in fact smaller. If you have a good suggestion as to how to clarify this I am happy to amend the specs. |
@neunhoef thanks, that makes things a bit clearer. My only suggestion could be to add it to the section where non-empty objects are defined, e.g. change from:
to match similar format/wording used in the arrays section, e.g.:
|
OK, will do. |
I've been working on a velocypack parser (in Rust), and ran into some troubles parsing some output from ArangoDB:
After some investigation, it looks like this was because my parser encountered 4 bytes of padding after parsing the
0x0c <byte length> <num items>
header (i.e.0x0c 0x73 0x01 0x12 0x00 0x00 0x00 0x00 0x00
).The specification doesn't mention padding in the Objects section, so would be useful to include some details on where padding can appear in objects (would have saved me a lot of debugging time :) ).
The text was updated successfully, but these errors were encountered: