On Sun, Jun 28, 2009 at 7:33 PM, Peter Duniho<pe...@nwlink.com> wrote: > Maybe I'm misreading one, or the other, or both of your messages, but it > seems to me that what Quincy wrote is in agreement with what you quoted. > > In particular, my (admittedly inexperienced) understanding is that an object > winds up "in the garbage collected zone" when code calls CFMakeCollectable. > Conversely, "GC-unaware code" would not, I would think, call > CFMakeCollectable (that seems like a very "GC-aware" thing to do, right?).
"NULL, kCFAllocatorDefault, and kCFAllocatorSystemDefault specify allocation from the garbage collection zone. "By default, all Core Foundation objects are allocated in the garbage collection zone." And while we're at it, CFMakeCollectable doesn't do *anything* magical, all it does is call CFRelease under GC, and assert that the object is in the right zone. If you know that you're running under GC and that the object will be in the garbage collected zone, it is *identical* to CFRelease: "Better still, though, you can use CFMakeCollectable instead of CFRelease. CFMakeCollectable calls CFRelease, but has two supplementary features: first, it halts the program if the object wasn't allocated in the scanned zone; second, it’s a no-op in a reference counted environment." Doesn't take any experience, just a bit of reading. I'd recommend that all participants in this thread read the Garbage Collection Programming Guide top to bottom before continuing any further.... Mike _______________________________________________ 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