Re: Memory Mania Revisted
Re: Memory Mania Revisted
- Subject: Re: Memory Mania Revisted
- From: email@hidden
- Date: Mon, 11 Feb 2002 16:26:45 -0800
Apparently, the shift to [[Foo alloc] init] from +new
happened around NeXTSTEP 2.0, and there may be something
in the 2.0/2.1 release notes.
The rationale was apparently related to the use of memory
zones, using +allocWithZone. Zones were introduced in 2.0
There's some discussion to be found on deja.com, especially
around 1991/1992. The deprecation of +new was apparently
taught at NeXT DevCamp classes.
After 2.0, +new was to be used for Singletons, in which there's only
ever one instance of the class.
It seems that this usage has been set aside in favor of more explicit
method names, such as [NSWorkspace sharedWorkspace] or [NSOpenPanel
openPanel].
(Probably as part of the general move towards more wordy method
signatures
in OpenStep.)
Interesting. Now, of course, use of zones is discouraged (they are
believed to actually make one's app *less* efficient, given the current
way memory allocation works in X), opening the way for a new renaissance
for +new... ;->
Ben Haller
Stick Software
_______________________________________________
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.