• 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: Immediate memory release
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Immediate memory release


  • Subject: Re: Immediate memory release
  • From: "Clark Cox" <email@hidden>
  • Date: Thu, 1 May 2008 07:16:03 -0700

On Thu, May 1, 2008 at 2:05 AM, Paul Bailey <email@hidden> wrote:
> The class documentation for NSAutoreleasePool notes that release is a no-op
>  on garbage-collected environments, and one should use drain to give the
>  garbage collector a hint to do its job (that's my limited understanding).
>  It notes that drains behaves the same as release in a memory managed
>  environment, so it's safe to use in both circumstances.

Joar wasn't disputing the use of -drain, he was asking about the use
of +new over +alloc/-init. AFAIK, there is no official documentation
that recommends the former over the latter.

>
>  Basically, if there's a chance your code might be garbage-collected, use
>  drain.
>
>  As for new, not sure...
>
>  Cheers,
>
>  Paul
>
>
>
>  On Thu, May 1, 2008 at 6:00 AM, j o a r <email@hidden> wrote:
>
>  >
>  > On Apr 30, 2008, at 7:27 PM, Jens Alfke wrote:
>  >
>  > I also changed the pool calls to the current recommended names: +new and
>  > > -drain.
>  > >
>  >
>  >
>  > Can you point me to where the official documentation recommends the use of
>  > +new over +alloc-init?
>  >
>  > Thanks,
>  >
>  > j o a r
>  >
>  >
>  >
>  > _______________________________________________
>  >
>  > 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
>  >
>  _______________________________________________
>
>
>
> 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
>



--
Clark S. Cox III
email@hidden
_______________________________________________

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: 
 >Re: Immediate memory release (From: "Paul Bailey" <email@hidden>)

  • Prev by Date: Re: Xcode debugger quality
  • Next by Date: Re: FSCopyObjectASync Not Calling Callback In Cocoa
  • Previous by thread: Re: Immediate memory release
  • Next by thread: Re: Immediate memory release
  • Index(es):
    • Date
    • Thread