discuss-gnustep
[Top][All Lists]
Advanced

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

Re: Automatic Reference Counting


From: Ivan Vučica
Subject: Re: Automatic Reference Counting
Date: Thu, 7 Jul 2011 20:23:48 +0200

Hi,

I just read this, so I have a couple of questions :-)

On Wed, Jun 29, 2011 at 15:36, David Chisnall <theraven@sucs.org> wrote:

ARC does some quite nice things for you.  For every assignment, the compiler will automatically insert calls to runtime functions that do the retain / release juggling for you.  It will also implicitly add code to your objects freeing all instance variables.  Because of this, some things are not allowed in ARC mode:

- Implementing -retain, -release, or -autorelease
- Calling -retain, -release, or -autorelease
- Storing object pointers that are not __unsafe_unretained qualified in structures.


If calling -retain, -release and -autorelease is not allowed, how is it possible to mix ARC with non-ARC code? Does the compiler throw a warning, an error, or the thing just silently doesn't work?

What happens when -retain, -release and -autorelease are overridden?

What happens when non-__unsafe_unretained pointers are stored in structure? Does it silently crash?

Are all pointers __strong by default? What happens with non-Objective-C pointers, such as results of SDL functions? Will I have any problems using SDL if ARC is used in same codebase?

--
Ivan Vučica
ivan@vucica.net


reply via email to

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