[swift-evolution] Proposal: [stdlib] Remove withUnsafe[Mutable]Pointer[s]()
jordan_rose at apple.com
Wed Dec 16 16:34:56 CST 2015
> On Dec 16, 2015, at 14:27 , Jordan Rose via swift-evolution <swift-evolution at swift.org> wrote:
>> On Dec 16, 2015, at 14:24 , Michael Gottesman via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
>>>> My fear about withExtendedLifetime is that the name is a misnomer. You are not extending the lifetime.
>>> I assume you mean that you don't need to extend the lifetime, rather than that it's not actually extending anything (because it is, it's just technically extending the lifetime of the UnsafePointer).
>> No, what I am saying is that withExtendedLifetime implies some sort of special lifetime extension (otherwise, why would one specifically call it out). It is not performing any sort of special lifetime extension, it is just using the normal lifetime extension rules.
> withExtendedLifetime does extend lifetime: it guarantees that the object will stay alive for the entire body of the closure, rather than being released early by ARC. It's similar to the 'objc_precise_lifetime' attribute in Clang.
Michael explained to me that his comments are referring to Kevin's proposed (?) new overload of withExtendedLifetime, not the existing overload which takes a value.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution