-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Word-based pointer APIs #68
Comments
Hm. I do wonder, however, if the following is allowed. In that case, the above is not required. let value = Int256.uninitialized { pointer in
for index in Int256.indices {
pointer.pointee[index] = UInt.zero // subscript calls UnsafeMutableRawPointer/storeBytes(of:toByteOffset:as:)
}
} Edit: I suppose the subscript access needs to be |
Hm. I suppose the following might count as a pointee read: // pointer.pointee[index] = UInt.zero
set {
let byteOffset = BitPattern.endiannessSensitiveByteOffset(unchecked: index)
Swift.withUnsafeMutablePointer(to: &self) { pointer in // ⚠️ inout pointee
UnsafeMutableRawPointer(pointer).storeBytes(of: newValue, toByteOffset: byteOffset, as: T.self)
}
} |
I just want an initialized junk allocation 😣 |
These APIs are (or would be) made obsolete by (#71). |
oscbyspro
added
no
don't even think about it
and removed
maybe
to do, or not to do?
labels
Aug 25, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following APIs circumnavigate uninitialized NBKDoubleWidth pointee access (#67).
New UnsafePointer APIs
New UnsafeMutablePointer APIs
The text was updated successfully, but these errors were encountered: