Re: Custom zones...
Re: Custom zones...
- Subject: Re: Custom zones...
- From: Bill Bumgarner <email@hidden>
- Date: Tue, 10 Aug 2010 06:55:49 -0700
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.
Zones were never very useful. They seemed like they might be, but proved to be vastly more problematic than useful.
(For those that don't know, the idea was to be able to create a zone for all of, say, a document's objects. Then, when the document was closed, you destroy the zone without destroying the individual objects.)
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!
Thus, zones haven't been used or really supported in a long, long, time. The only context where they would be safe to use is in sub-graphs of objects that are entirely comprised of classes you've written; where you control every last detail of the implementation and do not allow a reference to escape beyond your very well protected entry points into said sub-graph.
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