-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
Issue/3 #5
Conversation
|
||
unsafe fn store_unaligned(addr: *mut DataType, data: DataType) { | ||
*addr = data; | ||
} |
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.
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
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.
Nice catch. I randomly assumed pointer dereference was equivalent to ptr::read_unaligned
.
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.
I need to fix some code in tantivy too (O_o)
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.
I didn't do a thorough review, but it looks plausible!
No description provided.