-
Notifications
You must be signed in to change notification settings - Fork 124
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
Input length in Simple8b and Simple16 codecs #69
Comments
The assert is meant to check something that ought to be true. Why remove it? Note that you can remove asserts at compile-time.
Can you elaborate? Are you saying that you could have len == 0 and in64 > finalin64 as a valid result? |
Consider the On the other hand, Anyway, these variables are not involved in the decoding process, that is performed by using only the More specifically, if we don't know the input lenght, but we know the Since |
@gustingonzalez Please submit a PR. In your PR, document that "len = 0" means "len is unknown". I will merge it and you will be credited for the change. |
At the end of decoding in the specified codecs, some checks are performed to verify that the pointer of the input data is less than the estimated data to read:
https://github.com/lemire/FastPFor/blob/224fe919760c073566334dde6f510769aff41beb/headers/simple8b.h#L640
https://github.com/lemire/FastPFor/blob/224fe919760c073566334dde6f510769aff41beb/headers/simple16.h#L748
Although this makes sense in debug mode to check consistency, the
nvalue
parameter is enough to decode. So, if this check does not perform another task than the mentioned, (1) maybe thelen
parameter could be removed; or (2) the assertions could be modified to allowlen = 0
, which is useful when the datalen
is not known , e.g.:assert(len == 0 || in64 <= finalin64)
The text was updated successfully, but these errors were encountered: