discuss-gnustep
[Top][All Lists]
Advanced

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

Re: ANN: GNUstep Objective-C Runtime 1.4


From: Quentin Mathé
Subject: Re: ANN: GNUstep Objective-C Runtime 1.4
Date: Sat, 7 May 2011 12:47:59 +0200

Le 7 mai 2011 à 11:53, David Chisnall a écrit :

> On 7 May 2011, at 09:19, Wolfgang Lux wrote:
> 
>> PS: Don't tell me that the release calls in the sample program are 
>> redundant. I know you think they are, but I prefer writing code which is 
>> correct independent of its context.
> 
> The only one that is redundant is the destruction of the top-level 
> autorelease pool, which is an antipattern that forces potentially large 
> numbers of destructors to run when the program exits, which can cause heavy 
> swapping (since stuff in the top-level autorelease pool is often not 
> referenced for a very long time, it is most likely to be swapped out) at a 
> time when the user wants to reclaim the program's memory for other things.

On this topic, I have found that releasing the top pool can help to reveal some 
memory management issues (e.g. a crash in a -dealloc that doesn't occur all the 
time). So ideally it could be nice to have NSAutoreleasePool knows whether it 
is the top pool or not, then the top pool could release all the objects in 
"debug" mode but not when compiled in "release" mode.

Cheers,
Quentin.


reply via email to

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