discuss-gnustep
[Top][All Lists]
Advanced

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

Fw: Garbage collection with -finalize?


From: Markus Hitter
Subject: Fw: Garbage collection with -finalize?
Date: Fri, 2 Dec 2005 09:57:56 +0100



Hello Gentlemen,

it just came to my attention Apple plans on Garbage Collection for Mac OS X 10.5 and even offers some documentation already (that's very unusual).

Two things jump into my mind at the first reading:

 - Will GNUstep's GC be at least somewhat compatible with this?

 - If GNUstep provides this functionality soon or even today,
it should be a snap to attract some Cocoa developers starving for GC already.



Am 01.12.2005 um 15:40 schrieb Colin Barrett (on Apple's Cocoa Development list):


On Nov 30, 2005, at 8:45 PM, Shawn Erickson wrote:
Garbage collection is not yet supported on Mac OS X 10.4 (likely a
framework issue more then runtime library) but Apple is working on it,
why finalize showed up in NSObject. I doubt you will see it become
supported before 10.5 (assuming it become supported in 10.5).

See the gcc manpage:

       -fobjc-gc
Enable garbage collection (GC) for Objective-C objects. The resulting binary can only be used on Mac OS X 10.5 (Leopard) and later systems, due to additional functionality needed in the (NeXT)
           Objective-C runtime.

When the -fobjc-gc switch is specified, the compiler will replace assignments to instance variables (ivars) and to certain kinds of pointers to Objective-C object instances with calls to interceptor functions provided by the runtime garbage collector. Two type qualifiers, "__strong" and "__weak", also become available. The "__strong" qualifier may be used to indicate that assignments to variables of this type should generate a GC interceptor call, e.g.:

__strong void *p; // assignments to 'p' will have interceptor calls int *q; // assignments to 'q' ordinarly will not
                       ...
(__strong int *)q = 0; // this assignment will call an interceptor

Conversely, the "__weak" type qualifier may be used to suppress
           interceptor call generation:

__weak id q; // assignments to 'q' will not have interceptor calls id p; // assignments to 'p' will have interceptor calls
                       ...
(__weak id)p = 0; // suppress interceptor call for this assignment


Cheers,
Markus

- - - - - - - - - - - - - - - - - - -
Dipl. Ing. Markus Hitter
http://www.jump-ing.de/








reply via email to

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