• 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: Memory Mania Revisted
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Memory Mania Revisted


  • Subject: Re: Memory Mania Revisted
  • From: Izidor Jerebic <email@hidden>
  • Date: Tue, 12 Feb 2002 16:11:17 +0100

On Tuesday, February 12, 2002, at 01:26 AM, email@hidden wrote:

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


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... ;->


Well, main reason for alloc/init splitting as I remember was that when you do archiving/unarchiving (distributed objects, nib files, other document files, etc.), it is useful to have allocation and initialization as separate activities, so you can do -init for new objects and -initWithCoder: for archived objects which read values from somewhere.

And allocation of object (getting memory etc.) is something completely different than initialization, IMHO, so it is good to have those two things separated, anyway.

izidor
_______________________________________________
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.

References: 
 >Re: Memory Mania Revisted (From: email@hidden)

  • Prev by Date: Re: how to use Cocoa Java from Cocoa Obj-C code?
  • Next by Date: Re: PackageMaker and custom folder icons
  • Previous by thread: Re: Memory Mania Revisted
  • Next by thread: Re: Memory Mania Revisted
  • Index(es):
    • Date
    • Thread