• 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: Foundation Tool with GC?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Foundation Tool with GC?


  • Subject: Re: Foundation Tool with GC?
  • From: Bill Bumgarner <email@hidden>
  • Date: Wed, 12 Nov 2008 10:07:27 -0800

On Nov 12, 2008, at 9:30 AM, Karl Moskowski wrote:
I've been working on a Foundation tool project with garbage collection, and I've been wondering, what's needed (besides making GC required in the Xcode project) to ensure the garbage collector actually does its thing. Is it enough to call objc_startCollectorThread() once in main()? Should I also/instead call [NSGarbageCollector defaultCollector]?

objc_startCollectorThread() is required and that is it. The collector will run automatically


Depending on what you are doing, you may want to occasionally clear the stack using objc_clear_stack() to ensure that nothing is falsely rooted on the stack. You'll typically want to do this when the stack is as shallow as possible -- the top of your processing loop, if you have one.

You can also use objc_collect(OBJC_COLLECT_IF_NEEDED) to hint to the collector that a particular moment in the computation there may be a bunch of garbage to be collected.

b.bum

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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

References: 
 >Foundation Tool with GC? (From: Karl Moskowski <email@hidden>)

  • Prev by Date: Re: overt and covert retain-release question (instigated by UIViewController on iPhone)
  • Next by Date: MyDocument's Window Outlet...
  • Previous by thread: Foundation Tool with GC?
  • Next by thread: overt and covert retain-release question (instigated by UIViewController on iPhone)
  • Index(es):
    • Date
    • Thread