Where is the documentation for UnsafeRawPointer(bitPattern:)?

Google's says it's at the following, but in fact it is not:

Looks like it's here: https://github.com/apple/swift/blob/master/stdlib/public/core/Pointer.swift#L49

As for why it's not showing up online anymore, I'm fairly sure it's related to how the initializer is now implemented in an extension to _Pointer. Specifically, this commit in this PR. Public APIs that are implemented via underscored protocols don't show up in the documentation; the PR moved it out of a non-underscored type onto an underscored type, so it disappeared.

It looks like @nnnnnnnn correctly anticipated the potential documentation impact in his review on the PR, but it wasn't important enough to block it.

Thanks. Hopefully the issue will be resolved at some point.

It definitely won't be resolved if no one reports a bug.

That aside, what are you actually trying to do? The potential for misuse of this API is quite high, and there's more often than not a better way to do things.

Thanks for reporting it.
I am trying to address a literal address.
I don't know about "regular" operating systems, but I work with z/OS, which has a concept of 'control blocks' starting at address 0. These control blocks contain system data that can be accessed directly.
You can find more information if you are interested, here: http://www.longpelaexpertise.com/ezine/CtBlksBeginners2.php.

1 Like

glVertexAttribPointer ?

Yup, that sounds like a legitimate use case for this API.

1 Like
Terms of Service

Privacy Policy

Cookie Policy