haskell-capnp
haskell-capnp copied to clipboard
Deal with alignment issues when converting from ByteString to Segment ConstMsg
Right now we do this conversion in O(1) time via an unsafe cast. This is fine, except that right now we don't verify that the start of the ByteString is 64-bit word aligned. If not, on x86 this could cause unexpected slowness, on other architectures crashing. We should first check the alignment of the first byte, and if need be do a copy to fix it.