-
Notifications
You must be signed in to change notification settings - Fork 6
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
Storable instances have incorrect alignment #12
Comments
Good point! It should be documented that these instances only work with processors that support unaligned memory access (nearly all, and modern processors have nearly 0 overhead for unaligned access). Leaving this issue open to track the documentation concern. The alignment value is correct. |
One of the primary purposes of There are are still many platforms where alignment is important (for instance GPU programming). I think if it's going to stick with |
th-utilities does not respect alignment: fpco/th-utilities#12
Wouldn't it be possible to use "deriving via" wrappers with alignment as a phantom argument? deriving GStorable via Aligned 4 MyStuff (I know next to nothing about about deriving-via magic.) |
FTR, it should be possible to reconstruct Haskell record from SPIR-V reflection of its struct (glsl or otherwise) and make an exact Storable instance for it. |
Member alignment is also not respected. For example, the Storable instance of ...
... will not leave padding after p1 to keep p2 aligned. Please document that this does not create C compatible Storable instances. |
Seems to always be 1!
The text was updated successfully, but these errors were encountered: