[swift-evolution] RFC: Preventing Retain Cycles (Memory Ownership Model)

Chris Lattner clattner at apple.com
Sun Jul 31 00:09:49 CDT 2016


> On Jul 30, 2016, at 3:21 PM, Colin Barrett <colin at springsandstruts.com> wrote:
> 
>> - You can choose to use the memory ownership features by adding extra annotations, giving better performance and control over ARC.  Right now we have very limited options for avoiding ARC overhead in critical loops, largely forcing you to drop down to unsafe constructs.  We’d prefer the model to be “you can add more annotations to your code to get better performance, allowing the compiler statically verify correctness instead of dynamically”.
> 
> Has any thought been giving to opting in something analogous in the other direction—i.e. less performant, but less work for the programer? Specifically, I’ve long thought that an annotation opting into a runtime cycle collector (a la http://researcher.watson.ibm.com/researcher/files/us-bacon/Bacon01Concurrent.pdf <http://researcher.watson.ibm.com/researcher/files/us-bacon/Bacon01Concurrent.pdf>) would be very helpful for situations where, as you mention, performance is not (currently) critical.

We have certainly discussed cycle collectors in the past, even in the context of Objective-C, and have concluded that it would be a bad idea for several reasons.  If you’d like to discuss that, please start a new thread, thanks!

-Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160730/9b4371dc/attachment.html>


More information about the swift-evolution mailing list