-
Notifications
You must be signed in to change notification settings - Fork 11
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
Various fixes #9
Conversation
@@ -1,6 +1,5 @@ | |||
use libc::{c_int, c_uint, c_ulong, c_char, timeval, ssize_t}; | |||
use libc::{c_int, c_uint, c_ulong, c_char, timeval, ssize_t, IF_NAMESIZE }; |
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.
Could you remove the space before the }
here please?
If you follow that thread through, it looks like there's a workaround for getting alignment right, using simd types - rust-lang/rfcs#325 (comment) - is this an option here? |
Simd is experimental and not available on stable rust. |
I guess the real question is: do the alignment issues matter? Does it actually affect anything on the Rust side? If yes, perhaps it would be worth just using an array, and providing accessors/mutators to get at the misaligned fields, at least until Rust has native support? |
As far as I understand it's only a performance optimization and matters only in case we allocated it on the stack. We receive a pointer to it, so alignment is not our business. |
As long as everything works correctly on our end I'm happy. Thank you again for your work on this. |
These were mostly uncovered by ctest.
The biggest problem is in netmap_ring, i.e. functions operating on slots don't work without it.
ctest
still reports alignment problems, but it looks like this is impossible to solve in today's rust (rust-lang/rfcs#1358).