discuss-gnustep
[Top][All Lists]
Advanced

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

Re: NSProxy retain / release


From: Richard Frith-Macdonald
Subject: Re: NSProxy retain / release
Date: Thu, 30 Jun 2011 15:12:29 +0100

On 30 Jun 2011, at 14:57, David Chisnall wrote:

> Hi,
> 
> I was looking at NSProxy's code, and it seems to store its retain count in an 
> ivar, rather than using the standard one.  Is there a reason for this?  It 
> means that:
> 
> - NSProxy uses one word more than it needs to, two more than it needs to in 
> GC mode
> - -retain and -release on NSProxy subclasses are not thread-safe (they don't 
> use atomic ops)
> - -retainCount and NSExtraRefCount give different results (contrary to the 
> Cocoa behaviour)

My guess is that, while there may have been good reason at some point long ago, 
it's probably purely historic.
Since NSProxy does not inherit from NSObject, the two implementations are 
separate and NSProxy has most likely just not been updated in sync with 
NSObject.


reply via email to

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