Storable laws

Sven Panne svenpanne at gmail.com
Sat Dec 16 14:41:13 UTC 2017


2017-12-16 15:16 GMT+01:00 Henning Thielemann <lemming at henning-thielemann.de
>:

> I thought that arrays require alignment of their elements.


Yes, and if you start aligned, the pokeElemOff law keeps you aligned. If
you don't start aligned, Storable never magically aligns the first element,
anyway, so this must have been intentional (e.g. an array within packed
data).

In theory one could have an e.g. 7-byte data type with 8-byte alignment
requirements, but I think we can re-open the discussion when a processor
manufacturer is masochistic enough to do that. ;-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20171216/418d9c26/attachment.html>


More information about the Libraries mailing list