> On Dec 15, 2015, at 6:33 PM, Kevin Ballard via swift-dev 
> <swift-dev@swift.org> wrote:
> 
> On Tue, Dec 15, 2015, at 03:03 PM, Joe Groff via swift-dev wrote:
>> 
>> Yeah, it seems to me like a reasonable refinement for 'withUnsafePointer' to 
>> take an immutable parameter. Since this is a stdlib API change, you should 
>> suggest that on swift-evolution.
> 
> A change like that is going to break any code that relies on the inout 
> optimization (where it uses call-by-reference instead of copy-in copy-out 
> when possible). Yes, such code is in violation of Swift semantics today, but 
> it does work.

If a value is immutable, it should be easy for the compiler to reuse the 
address of memory it may already be using for it. 

-Joe
_______________________________________________
swift-dev mailing list
swift-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-dev

Reply via email to