[PATCH] D55865: [ObjC] Add a new attribute to opt-out of implicit callee retain/release in ARC
Erik Pilkington via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Dec 18 16:34:25 PST 2018
erik.pilkington created this revision.
erik.pilkington added reviewers: rjmccall, ahatanak, jordan_rose, aaron.ballman.
Herald added subscribers: dexonsmith, jkorous.
This attribute, called "objc_externally_retained", exposes clang's notion of pseudo-`__strong` variables in ARC. Pseudo-strong variables "borrow" their initializer, meaning that they don't retain/release it, instead assuming that someone else is keeping their value alive. If a parameter is annotated with this attribute, it isn't implicitly retained/released in the function body, and is implicitly `const`. This is useful to expose for performance reasons, most functions don't need the extra safety of the retain/release, so programmers can opt-out as needed.
Thanks for taking a look!
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 23864 bytes
Desc: not available
More information about the cfe-commits