• 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: Garbage collector vs variable lifetime
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Garbage collector vs variable lifetime


  • Subject: Re: Garbage collector vs variable lifetime
  • From: Quincey Morris <email@hidden>
  • Date: Sat, 7 Jun 2008 01:41:03 -0700


On Jun 7, 2008, at 00:07, Antonio Nunes wrote:

Although I maybe did not make it that clear, I actually meant my suggestion also as a question. I'm surprised no-one else suggested to temporarily turn of garbage collection for this pointer. I'm curious as to why Bill suggested his solution rather than directly instructing the garbage collector, since that would seem to me the more obvious solution. Is Bill's solution preferable in any way? (After all, I'd like to improve to the level where I know what I'm doing ;-)

I can think of one significant difference. Using CFRetain/CFRelease (or your slightly more general equivalent) is a procedural solution -- you would need to make sure there was a matching release on every execution path out of the relevant code.


Using something like '[data self]' is a syntactic solution. It doesn't matter whether it gets executed or not, but its mere presence far enough down the source code is all that's required.

Depending on the circumstances, one or other approach might be preferred.

_______________________________________________

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: Garbage collector vs variable lifetime
      • From: Ken Thomases <email@hidden>
References: 
 >Garbage collector vs variable lifetime (From: Quincey Morris <email@hidden>)
 >Re: Garbage collector vs variable lifetime (From: Bill Bumgarner <email@hidden>)
 >Re: Garbage collector vs variable lifetime (From: Ricky Sharp <email@hidden>)
 >Re: Garbage collector vs variable lifetime (From: Bill Bumgarner <email@hidden>)
 >Re: Garbage collector vs variable lifetime (From: Antonio Nunes <email@hidden>)
 >Re: Garbage collector vs variable lifetime (From: Ken Thomases <email@hidden>)
 >Re: Garbage collector vs variable lifetime (From: Antonio Nunes <email@hidden>)

  • Prev by Date: Re: Garbage collector vs variable lifetime
  • Next by Date: Re: Regular Expressions?
  • Previous by thread: Re: Garbage collector vs variable lifetime
  • Next by thread: Re: Garbage collector vs variable lifetime
  • Index(es):
    • Date
    • Thread