• 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: In-loop releasing of objects does not free memory?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: In-loop releasing of objects does not free memory?


  • Subject: Re: In-loop releasing of objects does not free memory?
  • From: Michael Watson <email@hidden>
  • Date: Thu, 14 Feb 2008 16:00:53 -0500

Nick is referring to this bit from the -drain documentation:

"In a garbage collected environment, triggers garbage collection if memory allocated since last collection is greater than the current threshold; otherwise behaves as release."

When you aren't using GC, calling -drain on your AutoreleasePool object will act just like you called -release on it. As a result, in a loop construct like that, you'll crash if you aren't using GC.


-- m-s

On 14 Feb, 2008, at 15:54, Randall Meadows wrote:

That'll cause a crash if GC isn't being used, since -drain is documented as doing the same thing as -release in non-GC applications.

I took that to mean that has the same effect on the *contents* of the pool (that is, releasing everything contained in the pool) but doesn't release the pool itself. Am I being too liberal in my interpretation, or are you talking about something else?
_____________

_______________________________________________

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: In-loop releasing of objects does not free memory?
      • From: Keith Duncan <email@hidden>
References: 
 >In-loop releasing of objects does not free memory? (From: Arthur C. <email@hidden>)
 >Re: In-loop releasing of objects does not free memory? (From: John Terranova <email@hidden>)
 >Re: In-loop releasing of objects does not free memory? (From: John Stiles <email@hidden>)
 >RE: In-loop releasing of objects does not free memory? (From: Arthur C. <email@hidden>)
 >Re: In-loop releasing of objects does not free memory? (From: Randall Meadows <email@hidden>)
 >Re: In-loop releasing of objects does not free memory? (From: Uli Kusterer <email@hidden>)
 >Re: In-loop releasing of objects does not free memory? (From: Nick Zitzmann <email@hidden>)
 >Re: In-loop releasing of objects does not free memory? (From: Randall Meadows <email@hidden>)

  • Prev by Date: setting Custom view into menuItem in Tiger
  • Next by Date: Re: In-loop releasing of objects does not free memory?
  • Previous by thread: Re: In-loop releasing of objects does not free memory?
  • Next by thread: Re: In-loop releasing of objects does not free memory?
  • Index(es):
    • Date
    • Thread