[swift-evolution] [Discussion] Cleaning up stdlib pointer and buffer routines (Open Issues Affecting Standard Library API Stability)

Erica Sadun erica at ericasadun.com
Wed Jul 6 08:38:30 CDT 2016


Starting a grouped discussion about these four:

* The global function withUnsafe[Mutable]Pointer(&x) should have an argument label “to”. (https://bugs.swift.org/browse/SR-1937 rdar://problem/26529498.)

I think this one is clear and obvious.

* Remove unsafeAddressOf. "We are not aware of any real use cases for it. If there are any, it should be renamed to unsafeAddress(of:) to follow the guidelines." (https://bugs.swift.org/browse/SR-1957 rdar://problem/18589289)

* Consider renaming or eliminating ManagedProtoBuffer. "The reason why ManagedProtoBuffer exists is to give the users an extra bit of type safety inside of the closure passed to ManagedBuffer.create(). This closure receives the ManagedBuffer instance and returns the initial value that is stored in the buffer (the header part of the buffer). We are passing the ManagedBuffer as ManagedProtoBuffer to prevent the closure from reading the uninitialized value property. Maybe this extra bit of safety is not worth the API surface complexity." (https://bugs.swift.org/browse/SR-1955 rdar://problem/26012924 rdar://problem/27118532.")

* withUnsafePointer shouldn't take its argument as inout. (https://bugs.swift.org/browse/SR-1956 rdar://problem/25019862) Note: "Jordan has objections, see https://bugs.swift.org/browse/SR-1956"

-- E
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160706/6d35db02/attachment.html>


More information about the swift-evolution mailing list