-
-
Notifications
You must be signed in to change notification settings - Fork 825
Add +strict-align
to .cargo/config
#12
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
Comments
@digitalstreamio this is now upstream and should land in the nightly toolchain sometime soon. Prevents #10 |
Awesome. I was just hit by this again while trying to copy data from device memory used by my sd card handling code to my app level state. I can certainly appreciate the generated code no longer halting the cpu ;). Out of curiosity though, are there any downsides to turning this on? |
Also, I will gladly give it a spin in a day or two once nightly picks it up. Cheers! |
With the option turned on, the compiler circumvents miss-aligned accesses by generating code in a way that it doesn't fail, eg using two 32bit accesses instead of one 64bit access if your operate on an address where modulo 8 != 0. This will cause your code to function, but probably it won't be the fastest possible code. So you gain that your code doesn't crash and trade It for potentially slight performance hits. |
Prevents issues like #10
The text was updated successfully, but these errors were encountered: