Re: [Leopard] Debugging GC
Re: [Leopard] Debugging GC
- Subject: Re: [Leopard] Debugging GC
- From: John Stiles <email@hidden>
- Date: Mon, 29 Oct 2007 11:26:16 -0700
On Oct 29, 2007, at 11:15 AM, mmalc crawford wrote:
On Oct 29, 2007, at 10:27 AM, John Stiles wrote:
Although, if retain/release/autorelease are no-op'ed but CFRetain
and CFRelease are not, won't that cause problems in that regard?
e.g. if I have some code that creates an NSString and passes it to
an OS library that takes a (toll-free-bridged) CFString, my calls
to update its refcount will be ignored, but the OS library calls
to update the refcount will be honored… so I can envision many
different scenarios where refcounts could easily get munged up.
It's not clear what the problem is -- you seem to be confused.
Provided that you -- or the framework -- balance your CFRetains and
CFReleases, it Just Works.
Well, with GC, retain counts are not needed, since objects are not
collected by their retain counts but rather by when they are
unreferenced. So there's no real problem per se. No actual memory leaks.
But if CFRetain(obj) will bump a refcount, while [obj release] will
fail to decrement it, it seems like it will be a common problem that
objects will have incorrect refcounts when they are collected.
It is perfectly legal to adjust a toll-free-bridged object's refcount
using either the CF calls (which work) or the NSObject calls (which
no-op).
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden