Aside from section 5.7 (storable) and comments on 'alignPtr', the only
mention of alignment in the FFI addendum is on
mallocBytes/allocaBytes:

"The block of memory is sufficiently aligned for any of the basic
foreign types (see Section 3.2) that fits into a memory block of the
allocated size"

It would be beneficial if this wording was applied to all allocation
routines - such as mallocForeignPtrBytes, mallocForeignPtrArray, etc.
For the curious, this proposal was born from the real-world issue of
pulling Word32's from a ByteString in an efficient but portable manner
(binary is portable but inefficient, a straight forward
unsafePerformIO/peek is efficient but need alignment).

If no glaring issue comes up then I'll formalize / make a ticket,
Thomas
_______________________________________________
Haskell-prime mailing list
Haskell-prime@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-prime

Reply via email to