• 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: Why the rules concerning release?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why the rules concerning release?


  • Subject: Re: Why the rules concerning release?
  • From: mmalcolm crawford <email@hidden>
  • Date: Sat, 31 Jul 2004 18:07:42 -0700

On Jul 31, 2004, at 4:49 PM, Mark Patterson wrote:

Is there a good reason or a historical reason for this duality? It might be nice of alloc and copy autoreleased their objects as well, for consistency. Why is that not done?

Efficiency.
Autoreleasing is in itself a more expensive operation than releasing (an object must be added to the autorelease pool, then subsequently sent another (release) message).
In addition, autoreleased objects(*) then persist until the autorelease pool is released. This increases memory consumption, unnecessarily, and may be significantly detrimental to performance (swapping).

mmalc


(*) In the sense of "objects whose retain count is 1 and which have received a single autorelease message and no other subsequent retain etc."
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Prev by Date: Re: Why the rules concerning release?
  • Next by Date: Re: CGShading
  • Previous by thread: Re: Why the rules concerning release?
  • Next by thread: One nib and controller per tab ?
  • Index(es):
    • Date
    • Thread