Re: Garbage collection with -finalize?
Re: Garbage collection with -finalize?
- Subject: Re: Garbage collection with -finalize?
- From: Colin Barrett <email@hidden>
- Date: Thu, 1 Dec 2005 09:40:06 -0500
- Resent-date: Thu, 1 Dec 2005 09:42:58 -0500
- Resent-from: Colin Barrett <email@hidden>
- Resent-message-id: <email@hidden>
- Resent-to: Cocoa ML <email@hidden>
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
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden