-
Notifications
You must be signed in to change notification settings - Fork 341
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rearrange struct members to avoid 64-bit int alignment issues
- Loading branch information
1 parent
e499a24
commit fce4234
Showing
1 changed file
with
1 addition
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fce4234
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 don't exactly understand this fix: is it simply to move the 64bit variables (i suppose that's a
long
) at the beginning of the struct, as first fields? (in this case there's only 1 field)Why is this a problem though?
fce4234
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.
It's a problem with a 32-bit ABI. My guess is that it triggered an unaligned access due to the way the structure was packed. See #469 for the problem that this fixed for me (and @gilbertchen noted this was an issue with atomic access).