-
Notifications
You must be signed in to change notification settings - Fork 602
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
The size encoded in a entry header contains the header it self. #266
Conversation
This make it possible to create entries of arbitrary size.
Any news here? Sometimes we get this error, so a fix would be nice. |
@Fabianexe Could you rebase? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix
Anything else needed here? I'd love to see this merged. |
On HEAD, I'm still seeing the error
What's blocking here? Do you want me to do some more evaluation before merging? |
Codecov Report
@@ Coverage Diff @@
## master #266 +/- ##
==========================================
+ Coverage 88.45% 89.22% +0.77%
==========================================
Files 15 15
Lines 762 761 -1
==========================================
+ Hits 674 679 +5
+ Misses 73 69 -4
+ Partials 15 13 -2
Continue to review full report at Codecov.
|
As #253 has pointed out, it is impossible to create an entry of arbitrary size in the byte queue. Basically, the problem is that at the points where the header gets larger, one number is skipped. This can lead to errors in the new allocation of a byte queue.
To solve this, the header size is included in the number that is encoded. This allows creating entries with arbitrary dimensions. For example, we have 127 bytes (1 header, 126 data), 128bytes (2 header, 126 data), and 129 bytes(2 header, 127 data).
As a benefit, we can reduce some calculations, and the code gets more straightforward.
The only downside is that the maximum entry size reduces from
4294967296
to4294967291
bytes. In my belief, nothing too dramatic that gets in v3 with uint64, even a more minor problem.