You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note that this API should support unaligned data. Until UnsafeRawPointer directly supports unaligned loads, the implementation will need to create a temporary variable and copy bytes into it using withUnsafeButes(of: &var). See Unaligned UnsafeRawPointer loads
We could consider altenatives to the copyBytes name. It is analgous to
UnsafeRawBufferPointer.load(fromByteOffset:as:)
...but Data APIs should be expressed as Collection indices, not byte offsets, which are not the same thing for Data slices.
Additionally, we could have extensions on the basic scalar data types, although this can't completely replace the primitive copyBytes.
Additional Detail from JIRA
md5: 9114378c80fc22dfef1c2f8e6aee6a92
Issue Description:
The fundamental operations are:
Note that this API should support unaligned data. Until UnsafeRawPointer directly supports unaligned loads, the implementation will need to create a temporary variable and copy bytes into it using
withUnsafeButes(of: &var)
. See Unaligned UnsafeRawPointer loadsWe could consider altenatives to the
copyBytes
name. It is analgous to...but Data APIs should be expressed as Collection indices, not byte offsets, which are not the same thing for Data slices.
Additionally, we could have extensions on the basic scalar data types, although this can't completely replace the primitive
copyBytes
.See Forum post: withUnsafeBytes is deprecated
The text was updated successfully, but these errors were encountered: