haskell-capnp icon indicating copy to clipboard operation
haskell-capnp copied to clipboard

Deal with alignment issues when converting from ByteString to Segment ConstMsg

Open zenhack opened this issue 6 years ago • 0 comments

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.

zenhack avatar Jul 22 '18 16:07 zenhack