On Oct 7, 2009, at 1:47 PM, Gabriel Zachmann wrote:

I did that and there is one sentence that I don't understand at all:

"CFMakeCollectable calls CFRelease, but has two supplementary features: [...]; second, it’s a no-op in a reference counted environment."

Shouldn't that be "a no-op in a GC environment." ?


No. CFRetain & CFRelease continue to work the same regardless of GC. That is, the reference count field still exists, but Obj-C objects in GC start life with a 0 retain count and -retain/-release/-retainCount/- autorelease are no-op'd. CF objects still start life with a retain count of 1, and thus you need to release them in order for them to participate in GC. Since you do not want to release them in a ref counted environment, CFMakeCollectable (and NSMakeCollectable) need to do nothing in ref-counted (or your objects would vanish) and CFRelease (not -release) in a GC environment.
--
David Duncan
Apple DTS Animation and Printing

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to