How did you come to that conclusion? In Swift 2.1 (I'm late to update), with 
optimizations on, this function:

> func test() -> Double {
>       return Double(arc4random())
> }


compiles to:

> define hidden double @_TF4test4testFT_Sd() #0 {
> entry:
>   %0 = tail call i32 @arc4random()
>   %1 = uitofp i32 %0 to double
>   ret double %1
> }

which has no allocation at all.

Félix
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to