3 ms·
Reference counted pointers can deference an object (via a strong pointer) without checking the reference count. The reference count is accessed only on operatio
by marcianx 1y ago
Reference counted pointers can deference an object (via a strong pointer) without checking the reference count. The reference count is accessed only on operations like clone, destruction, and such. That being said, access via a weak pointer does require a reference count check.
- fulafel 1y agoThis sounds different from common refcounting semantics in other languages, is it really so in Swift? Usually access increases the reference count (to avoid the object getting GC'd while you use it) and weak pointers are the exception where you are prepared for the object reference to suddenly become invalid.