
16 Dec
2017
16 Dec
'17
2:16 p.m.
On Sat, 16 Dec 2017, Sven Panne wrote:
2017-12-16 6:33 GMT+01:00 David Feuer
: The documentation for pokeByteOff indicates that the following equality holds: pokeElemOff addr idx x = poke (addr `plusPtr` (idx * sizeOf x)) x
[...] Was this intentional?
Yep, that was intentional, think of pokeElemOff as indexing into an array. Note that the FFI intentionally does not specify how to (un)marshal structs, only basic types and arrays of them.
I thought that arrays require alignment of their elements.