-
Notifications
You must be signed in to change notification settings - Fork 757
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
Eliminate seed from XXH32_state_s #79
Comments
Thanks @stbrumme, this is an excellent idea. While it's certainly possible to implement it, I'm nonetheless worried about a possible ABI break when reducing structure size.
This scenario is supposed to be explicitly forbidden in So a cautious transition scenario could be as follows :
It should reduce risks in case of version mismatch, by allowing an "overlap" period, where the structure is compatible with older implementations, and implementation is compatible with future structure. For discussion |
Partly implemented in v0.6.2. |
The seed variable is stored in the XXH32_state_s struct because it's used when XXH32_digest_endian() is called after less than 16 bytes. However, that means that state->v1...v4 are is still unmodified and especially state->v3 has it's initial value which was state->seed.
If you replace line 665 by "h32 = state->v3 + PRIME32_5;" then we can get rid of state->seed.
See my xxHash implementation at http://create.stephan-brumme.com/xxhash/ (written from scratch) for a proof-of-concept.
I haven't analyzed xxHash64 yet, but after a quick look at your code it seems we could apply the same trick.
The text was updated successfully, but these errors were encountered: