3 ms·
How would that work? The refcount need to be on the pointee, not on the pointer.
by gpderetta 6y ago
How would that work? The refcount need to be on the pointee, not on the pointer.
- saagarjha 6y agoIt’s stored in the isa pointer inside the object.
- gpderetta 6y agothanks, it makes sense now. For what I understand, the isa pointer is sorta-kinda similar to a vtable pointer in C++.
- saagarjha 6y agoYep. It’s actually a pointer to the class instance for the object, which is a full object that contains more information than a typical vtable might, but it serves as a “type ID” that the runtime can use to dispatch on.