discuss-gnustep
[Top][All Lists]
Advanced

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

Re: GNUstep and valgrind


From: David Chisnall
Subject: Re: GNUstep and valgrind
Date: Fri, 16 Mar 2018 08:59:03 +0000

On 16 Mar 2018, at 08:51, Fred Kiefer <fredkiefer@gmx.de> wrote:
> 
> 1) David would probably point you to the usage of ARC but as far as I 
> understand you are using gcc and this is no option for your.

Note that even if you’re using GCC, if you’re using libobjc2 then you can call 
the ARC objc_retainAutoreleasedReturnValue function explicitly, rather than 
sending a -retain message to an autoreleased value.  This will pop the top 
object from the autorelease pool and transfer ownership of it to the caller.  
The caller is then responsible for releasing it.

In a system with realtime requirements, autorelease pools are a really bad 
idea.  They will introduce pauses proportional to the total number of objects 
in the pool when they are destroyed.  Most realtime systems don’t allow 
allocating objects at all, so Objective-C is probably exactly the wrong choice 
for them.

David




reply via email to

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