discuss-gnustep
[Top][All Lists]
Advanced

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

Re: Weak dictionaries


From: David Chisnall
Subject: Re: Weak dictionaries
Date: Thu, 14 Jun 2012 10:09:01 +0100

NSMapTable and NSPointerArray work in GC mode.  They were working in ARC mode, 
but it turns out that Apple implements the wrong semantics for them so they're 
now broken to be Apple compatible.

In both ARC and GC modes, the __weak qualifier works correctly[1], so there's 
no reason why implementing such a thing should be hard.  Reintroducing the sane 
semantics for NSMapTable and friends (where weak means weak) as an optional 
GNUstep extension is something that has been on my todo list for a while but 
got bumped down by higher-priority things.

David

[1] If you compile with clang and link with GNUstep libobjc

On 14 Jun 2012, at 10:04, Thomas Davie wrote:

> Hi all,
> 
> Just wondering before I go off and code my own... Does anyone know of an 
> implementation of a weak dictionary (or array/set for that matter) that 
> compiles successfully on GNUstep?  There's obviously MAWeakDictionary, but 
> that's heavily reliant on chunks of CF that don't exist.  I could go out 
> there and make an NSDictionary like thing that wraps every object you put in 
> it in a weak reference object, but it seems like there should be a pre-baked 
> solution to this.
> 
> Tom Davie
> _______________________________________________
> Discuss-gnustep mailing list
> Discuss-gnustep@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnustep


-- Sent from my PDP-11




reply via email to

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