Skip to content
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

Mind alignment #3

Closed
bluss opened this issue Aug 13, 2015 · 2 comments
Closed

Mind alignment #3

bluss opened this issue Aug 13, 2015 · 2 comments
Labels

Comments

@bluss
Copy link

bluss commented Aug 13, 2015

The code in number_streams is cool, but from a cursory look it seems to cast a u8 pointer directly to a u64 pointer, which is not correct in general.

This depends on the platform / architecture, some tolerate loading from ill aligned addresses fine and some don't. x86-64 is generally fine, and why we don't see much trouble, but on other platforms you will.

This blog mentions using memcpy to let the compiler decide how to load from a possibly ill aligned address. This is what google's farmhash does too, and it's also what I updated SipHash to do, see rust-lang/rust#27280.

@bluss
Copy link
Author

bluss commented Aug 26, 2015

@shepmaster shepmaster added the bug label Jun 26, 2019
@shepmaster
Copy link
Owner

I think this is finally addressed!

68fede8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants