Re: Why the rules concerning release?
Re: Why the rules concerning release?
- Subject: Re: Why the rules concerning release?
- From: mmalcolm crawford <email@hidden>
- Date: Sat, 31 Jul 2004 18:07:42 -0700
On Jul 31, 2004, at 4:49 PM, Mark Patterson wrote:
Is there a good reason or a historical reason for this duality? It
might be nice of alloc and copy autoreleased their objects as well,
for consistency. Why is that not done?
Efficiency.
Autoreleasing is in itself a more expensive operation than releasing
(an object must be added to the autorelease pool, then subsequently
sent another (release) message).
In addition, autoreleased objects(*) then persist until the autorelease
pool is released. This increases memory consumption, unnecessarily,
and may be significantly detrimental to performance (swapping).
mmalc
(*) In the sense of "objects whose retain count is 1 and which have
received a single autorelease message and no other subsequent retain
etc."
_______________________________________________
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.