<div dir="ltr"><div>I vaguely recall that this was because 16 byte alignment is the minimum you need for certain foreign types, and it's what malloc() does. Perhaps check the FFI spec and the guarantees that mallocForeignPtrBytes and friends provide?</div><div><br></div><div>Cheers</div><div>Simon<br></div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, 11 Oct 2018 at 18:44, Ömer Sinan Ağacan <<a href="mailto:omeragacan@gmail.com">omeragacan@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I just found out we currently align all pinned array payloads to 16 bytes and<br>
I'm wondering why. I don't see any comments/notes on this, and it's also not<br>
part of the primop documentation. We also have another primop for aligned<br>
allocation: newAlignedPinnedByteArray#. Given that alignment behavior of<br>
newPinnedByteArray# is not documented and we have another one for aligned<br>
allocation, perhaps we can remove alignment in newPinnedByteArray#.<br>
<br>
Does anyone remember what was the motivation for always aligning pinned arrays?<br>
<br>
Thanks<br>
<br>
Ömer<br>
_______________________________________________<br>
ghc-devs mailing list<br>
<a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><br>
</blockquote></div>