• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [Leopard] Debugging GC
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: [Leopard] Debugging GC
      • From: mmalc crawford <email@hidden>
References: 
 >[Leopard] Debugging GC (From: Pierre Bernard <email@hidden>)
 >Re: [Leopard] Debugging GC (From: Bill Bumgarner <email@hidden>)
 >Re: [Leopard] Debugging GC (From: John Stiles <email@hidden>)
 >Re: [Leopard] Debugging GC (From: mmalc crawford <email@hidden>)

  • Prev by Date: Any word on developers already designing a new Xcode book ?
  • Next by Date: Re: [Leopard] Debugging GC
  • Previous by thread: Re: [Leopard] Debugging GC
  • Next by thread: Re: [Leopard] Debugging GC
  • Index(es):
    • Date
    • Thread