discuss-gnustep
[Top][All Lists]
Advanced

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

Re: Weak dictionaries


From: Thomas Davie
Subject: Re: Weak dictionaries
Date: Thu, 14 Jun 2012 10:53:52 +0100

On 14 Jun 2012, at 10:41, David Chisnall wrote:

> On 14 Jun 2012, at 10:23, Thomas Davie wrote:
> 
>> Thanks David,
>> 
>> I did not know NSMapTable existed, and indeed, providing the ability to have 
>> ZWRs to the objects (but still copied keys) is exactly what I was after.  
>> Can you elaborate on exactly how Apple's semantics here are "wrong"?
> 
> In OS X (and GNUstep since we fixed that 'bug'), a map table that is supposed 
> to have weak values actually has unsafe unretained values.  This is 
> compatible with the old mode before zeroing weak references were possible, 
> but is a bit ugly.

Okay, that bug appears to be prohibitive for me using NSMapTable here, as I 
really do need zeroing weak values, I guess I'll use an NSDictionary and wrap 
the objects in it in weak reference objects... This brings me to one final 
question: How would one go about writing a GNUmakefile that specifies that 
exactly 1 file should be compiled using -fobjc-arc?

Thanks

Tom Davie


reply via email to

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