• 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 Collection OFF By Default?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Garbage Collection OFF By Default?


  • Subject: Re: Garbage Collection OFF By Default?
  • From: "David H. Silber" <email@hidden>
  • Date: Thu, 11 Dec 2008 00:06:32 -0500

On Wed, Dec 10, 2008 at 09:36:49PM -0800, Chris Espinosa wrote:
> On Dec 10, 2008, at 8:16 PM, David H. Silber wrote:
>
> >With a "Cocoa Application" project newly created with Xcode 3.1.2, I
> >notice that Garbage Collection is set to "Unsupported".  This
> >surprises
> >me as I would think that GC would be preferable for all applications
> >but
> >the most performance-critical.  Can anyone speak knowledgeably about
> >why
> >that is the default and what downsides there would be to turning it
> >on?
> >
> >I note that some Objective-C 2.0 features are not available for 32-bit
> >platforms, but I haven't seen anything that would suggest that GC is
> >one
> >of those features.
> >
> >(Leopard on a G4, if that makes a difference.)
> >
> >For others who might want to play along at home, the setting is hiding
> >in:
> >   Project --> Edit Project Settings --> Build -->
> >   GCC 4.0 - Code Generation --> Objective-C Garbage Collection
> >Configuration is set to: "Active (Debug)"
>
> Because most extant documentation teaches how to write a retain/
> release style app, we're not comfortable (in Leopard) pulling the rug
> out from under novices by making their first project use an entirely
> different memory management system than they read about in the Cocoa
> books.  For now, Garbage Collection is opt-in.

Thank you for that explanation.


> Two notes about your suggestion:
>
> 1) You can indeed set it at the project level, but because any setting
> at the Target level will supersede, most people make substantive code-
> model settings like this on the Target, for reliability.

> 2) If you set GC you ought to set it for all configurations.  It would
> be somewhat disheartening to debug your GC code then ship a non-GC
> version that ends up leaking.

Thank you for clueing me in.  I threw that path in because I spent a
non-trivial amount of time searching for the GC setting and hoped to
save someone else that pain.  Your notes will undoubtably save me a
week's worth of pulling my hair out sometime in the future.


David

--
David H. Silber  --  http://DavidSilber.name/
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Garbage Collection OFF By Default? (From: "David H. Silber" <email@hidden>)
 >Re: Garbage Collection OFF By Default? (From: Chris Espinosa <email@hidden>)

  • Prev by Date: Re: Garbage Collection OFF By Default?
  • Next by Date: Re: Which SDK is recommended when doing both Mac and iPhone development?
  • Previous by thread: Re: Garbage Collection OFF By Default?
  • Next by thread: weird things with safe iterators in xcode debug configurations
  • Index(es):
    • Date
    • Thread