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

Issue/3 #5

Merged
merged 8 commits into from
Apr 10, 2018
Merged

Issue/3 #5

merged 8 commits into from
Apr 10, 2018

Conversation

fulmicoton
Copy link
Contributor

No description provided.


unsafe fn store_unaligned(addr: *mut DataType, data: DataType) {
*addr = data;
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The above two methods should either have their names change to use aligned instead of unaligned, or the implementations of these methods should use actual unaligned reads/writes. See https://doc.rust-lang.org/std/ptr/fn.read_unaligned.html and https://doc.rust-lang.org/std/ptr/fn.write_unaligned.html

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch. I randomly assumed pointer dereference was equivalent to ptr::read_unaligned.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to fix some code in tantivy too (O_o)

Copy link

@BurntSushi BurntSushi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't do a thorough review, but it looks plausible!

@fulmicoton fulmicoton merged commit abf267b into master Apr 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants