gnustep-dev
[Top][All Lists]
Advanced

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

Re: GSIMap


From: Richard Frith-Macdonald
Subject: Re: GSIMap
Date: Wed, 1 Jun 2011 23:20:51 +0100

On 1 Jun 2011, at 19:30, David Chisnall wrote:

> Hi,
> 
> I'm trying to make NSHashTable / NSMapTable use the correct read / write 
> barrier functions in GC mode, but I don't really understand the GSIMap code.  
> Does it define macros for reading / writing pointers anywhere?  In GC mode, 
> we need to call the relevant read and write barrier functions for assigning 
> pointer values, depending in the pointer functions:

NSHashTable and NSMapTable use both NSPointerFunctions and the old callbacks 
(Apple added new classes for these objects, while retaining backward 
compatibility with the old API)... see NSConcretePointerFunctions.[hm] for the 
new functions  and the CallBacks files for the old ones.

If you look at the actual hash/map table code (eg NSConcreteHashTable.m) you 
will see the defines which tell GSIMAP which versions to use.
eg.
#define GSI_MAP_RETAIN_KEY(M, X)\
 (M->legacy ? M->cb.old.retain(M, X.ptr) \
 : pointerFunctionsAcquire(&M->cb.pf, &X.ptr, X.ptr))




reply via email to

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