bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GDL2 - patches for OSX (2)


From: Stéphane Corthésy
Subject: Re: GDL2 - patches for OSX (2)
Date: Wed, 26 Mar 2003 10:27:09 +0100

Hi,

On Wednesday, Mar 26, 2003, at 09:45 Europe/Zurich, Manuel Guesdon wrote:

Hi Stéphane,

On Tue, 25 Mar 2003 23:00:42 +0100 Stéphane Corthésy <stephane@sente.ch> wrote:
| Index: EOOrQualifier.m
| ===================================================================
| RCS file:
| /cvsroot/gnustep/gnustep/dev-libs/gdl2/EOControl/EOOrQualifier.m,v
| retrieving revision 1.7
| diff -r1.7 EOOrQualifier.m
| 56c56
| < return [[[self alloc] initWithQualifierArray: array] autorelease];
| ---
| > return AUTORELEASE([[self alloc] initWithQualifierArray: array]);
| 89c89
| <   NSMutableArray *qualArray = [NSMutableArray array];
| ---
|  >   NSMutableArray *qualArray = [[NSMutableArray alloc] init];


For this one, I usually prefer:
NSMutableArray *qualArray = (NSMutableArray*)[NSMutableArray array];
because:
o we don't need to know how NSMutableArray make it's allocation and initialization o if we want to track memory leaks, it's easier to make a grep on alloc and check cases if there's not too much ones (i.e. if alloc are mainly done in objects constructors).


Tracking memory leaks and zombies is not as easy as searching alloc/release/autorelease/etc. It's much more complicated than this. By creating some many autoreleased objects you're shooting yourself in the foot IMHO. You'll get in troubles when it comes to find zombies... One of the big problems of EOF is the large number of transient objects created during operations: the more autoreleased object you create, the slower your application will become, and the harder it is to correct zombies.

While I don't agree with you on that point, I guess that other gnustep people think the way you do, so I'll stop coming again and again on that.

Stéphane





reply via email to

[Prev in Thread] Current Thread [Next in Thread]