mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
ARC operations don't have an effect on immortal objects, like the empty array singleton or statically allocated arrays. Therefore we can freely remove and retain/release instructions on such objects, even if there is no paired balanced ARC operation. This optimization can only be done with a minimum deployment target of Swift 5.1, because in that version we added immortal ref count bits. The optimization is implemented in libswift. Additionally, the remaining logic of simplifying strong_retain and strong_release is also ported to libswift. rdar://81482156
1.9 KiB
1.9 KiB