RE: Memory Management
RE: Memory Management
- Subject: RE: Memory Management
- From: "Jonathan E. Jackel" <email@hidden>
- Date: Tue, 29 Jul 2003 13:05:36 -0400
>
Anyway, the issue that you, as well as most
>
other advocates of autoreleasing accessors so far, are carefully
>
avoiding is that the autoreleasing accessor only has an "advantage" in
>
situations where you somehow mess with the containing object. In my
>
last decade of Cocoa programming, these have been so exceedingly rare
>
as to be effectively non-existent. So I strongly dispute that this
>
practice has any measurable *practical* benefit, whereas it has real
>
and quite measurable cost in terms of performance as well as a cost in
>
term of program clarity and object semantics.
Perhaps I've missed some crucial point, but if an object is concerned that
someone might access one of its variables just before the object dies and
releases its ivars, and the object always gets to make a deathbed bequest
(via -dealloc), then autoreleasing ivars in -dealloc (rather than simply
releasing them) would solve the problem (if you think there is one) at a
fraction of the cost of using [[retain] autorelease] in every accessor.
Less code, fewer retains, fewer autoreleases.
If this is a lame idea, someone please say so.
Jonathan
_______________________________________________
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.