• 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: Chris Espinosa <email@hidden>
  • Date: Wed, 10 Dec 2008 21:36:49 -0800

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.


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.

Chris
_______________________________________________
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


  • Follow-Ups:
    • Re: Garbage Collection OFF By Default?
      • From: "David H. Silber" <email@hidden>
References: 
 >Garbage Collection OFF By Default? (From: "David H. Silber" <email@hidden>)

  • Prev by Date: Garbage Collection OFF By Default?
  • Next by Date: Re: Garbage Collection OFF By Default?
  • Previous by thread: Garbage Collection OFF By Default?
  • Next by thread: Re: Garbage Collection OFF By Default?
  • Index(es):
    • Date
    • Thread