mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
hashtable bugfix
GSI code version optional. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@12358 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
121c5d6b2e
commit
3e354cabb1
14 changed files with 150 additions and 17 deletions
|
@ -110,16 +110,20 @@ static void obsRetain(Observation *o);
|
|||
static void obsFree(Observation *o);
|
||||
|
||||
|
||||
#define GSI_NEW 1
|
||||
|
||||
#define GSI_ARRAY_TYPES 0
|
||||
#ifdef GSI_NEW
|
||||
#define GSI_ARRAY_TYPE Observation*
|
||||
|
||||
#define GSI_ARRAY_RELEASE(A, X) obsFree(X.ext)
|
||||
#define GSI_ARRAY_RETAIN(A, X) obsRetain(X.ext)
|
||||
#else
|
||||
#define GSI_ARRAY_EXTRA Observation*
|
||||
#define GSI_ARRAY_RELEASE(X) obsFree(X.ext)
|
||||
#define GSI_ARRAY_RETAIN(X) obsRetain(X.ext)
|
||||
#endif
|
||||
|
||||
#include <base/GSIArray.h>
|
||||
|
||||
#ifdef GSI_NEW
|
||||
#define GSI_MAP_RETAIN_KEY(M, X)
|
||||
#define GSI_MAP_RELEASE_KEY(M, X) ({if ((((gsaddr)X.obj) & 1) == 0) \
|
||||
RELEASE(X.obj);})
|
||||
|
@ -127,6 +131,15 @@ static void obsFree(Observation *o);
|
|||
#define GSI_MAP_EQUAL(M, X,Y) doEqual(X.obj, Y.obj)
|
||||
#define GSI_MAP_RETAIN_VAL(M, X)
|
||||
#define GSI_MAP_RELEASE_VAL(M, X)
|
||||
#else
|
||||
#define GSI_MAP_RETAIN_KEY(X)
|
||||
#define GSI_MAP_RELEASE_KEY(X) ({if ((((gsaddr)X.obj) & 1) == 0) \
|
||||
RELEASE(X.obj);})
|
||||
#define GSI_MAP_HASH(X) doHash(X.obj)
|
||||
#define GSI_MAP_EQUAL(X,Y) doEqual(X.obj, Y.obj)
|
||||
#define GSI_MAP_RETAIN_VAL(X)
|
||||
#define GSI_MAP_RELEASE_VAL(X)
|
||||
#endif
|
||||
|
||||
#define GSI_MAP_KTYPES GSUNION_OBJ|GSUNION_INT
|
||||
#define GSI_MAP_VTYPES GSUNION_PTR
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue