• 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: Custom zones...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Custom zones...


  • Subject: Re: Custom zones...
  • From: Alastair Houghton <email@hidden>
  • Date: Tue, 10 Aug 2010 15:12:10 +0100

On 10 Aug 2010, at 14:55, Bill Bumgarner wrote:

> On Aug 10, 2010, at 1:31 AM, Alastair Houghton wrote:
>
>> Sounds like a bug to me.  While zones are *discouraged* (they're very definitely an advanced topic and easily misused), I don't think they're actually deprecated.
>
> Their use is deprecated and should be documented as such.

I guess that's a documentation bug, then, since there don't seem to be many deprecation markings that I can see, and NSZone is documented all over the place.

> The key problems were two fold.   First, if a reference to an object in the zone escaped said zone and wasn't cleaned up prior to zone destruction, you ended up with an entirely unfathomable crash.   This happened often.   Secondly, if any object was allocated in the zone that required some kind of more-than-dealloc-or-free operations to occur when deallocated, the zone's destruction would bypass that.  Nothing like a dangling backing store [window] to brighten your debugging day!

Indeed, that's why I said "easily misused".

That said, is the part about objects escaping zones really true for *NS*Zone?  It's true for malloc zones, for sure, but the docs for NSRecycleZone say:

  Frees zone after adding any of its pointers still in use to the default zone.
  (This strategy prevents retained objects from being inadvertently destroyed.)

which seems to imply otherwise.

You *are* just talking about *NS*Zone, right?  malloc zones are very useful and I definitely don't want to see those go away (I'm thinking of a certain million-plus node data structure we maintain that we'd have to go calling free() a million or more times to release...)

Kind regards,

Alastair.

--
http://alastairs-place.net




_______________________________________________

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: Custom zones...
      • From: Bill Bumgarner <email@hidden>
References: 
 >Custom zones... (From: "charlie" <email@hidden>)
 >Re: Custom zones... (From: Alastair Houghton <email@hidden>)
 >Re: Custom zones... (From: Bill Bumgarner <email@hidden>)

  • Prev by Date: Fwd: Math.h functions with CGFloat
  • Next by Date: Re: Math.h functions with CGFloat
  • Previous by thread: Re: Custom zones...
  • Next by thread: Re: Custom zones...
  • Index(es):
    • Date
    • Thread