[swift-users] raw buffer pointer load alignment

Kelvin Ma kelvin13ma at gmail.com
Wed Nov 8 18:54:09 CST 2017


According to the docs
<https://developer.apple.com/documentation/swift/unsaferawbufferpointer/2632297-load>,
the load(fromByteOffset:as:) method requires the instance to be “properly
aligned” Does that mean if I have raw data meant to be interpreted as

0      1      2      3      4      5      6
[ Int8 |    Int16    |    Int16    | Int8 | Int8 ]


i can’t just load the Int16 from byte offset 1?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20171108/1eb5b958/attachment.html>


More information about the swift-users mailing list