• 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: [Foo new] vs [[Foo alloc] init]:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Foo new] vs [[Foo alloc] init]:


  • Subject: Re: [Foo new] vs [[Foo alloc] init]:
  • From: Bill Bumgarner <email@hidden>
  • Date: Sat, 16 Feb 2008 17:25:26 -0800

On Feb 16, 2008, at 4:49 PM, Keith Duncan wrote:
I'm guessing, but perhaps the assumption made on Apple's part is that if you are linking against the 10.5 SDK then your are more then likely using GC and zones are irrelevant? AFAIF zones can be used to improve alloc/dealloc performance, i.e they can be setup such that the cost of dealloc'ing a large group of temporary objects is very low by simply removing references to their heap section allowing immediate reuse without the dealloc tear down cost. Correct me if I'm wrong.

That is part of the answer.

Another issue is that there is no -dealloc upon zone destruction. Thus, any class whose instances require some kind of tear down at time of destruction are going to cause major problems. The resulting bugs are often subtle, difficult to deduce, and the fix is often to effectively start doing full-on retain/release in the zone, obviating the point of such a zone in the first place.

As well, any object graph maintained within a zone must be entirely isolated from the rest of your app's object graph upon zone destruction. This includes stuff like run loops and the notification center.

Finally, zones actually tended to fragment the heap unless used extremely carefully.

While zones were a good idea, their use tended to be more problematic than a boon.

b.bum
_______________________________________________

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: [Foo new] vs [[Foo alloc] init]: (From: Jonathan Dann <email@hidden>)
 >Re: [Foo new] vs [[Foo alloc] init]: (From: Keith Duncan <email@hidden>)

  • Prev by Date: Re: Xcode 2.5, ppc, link errors
  • Next by Date: Re: Loading saved file into NSArrayController
  • Previous by thread: Re: [Foo new] vs [[Foo alloc] init]:
  • Next by thread: duplicate interface error
  • Index(es):
    • Date
    • Thread