mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 16:50:58 +00:00
Fix maptable errors
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@12381 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
8807074b83
commit
ba15591db2
1 changed files with 9 additions and 7 deletions
|
@ -75,6 +75,7 @@ static BOOL deallocNotifications = NO;
|
||||||
* correct zone to free memory very fast.
|
* correct zone to free memory very fast.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* retain_counts_gate is needed when running multi-threaded for retain/release
|
* retain_counts_gate is needed when running multi-threaded for retain/release
|
||||||
* to work reliably.
|
* to work reliably.
|
||||||
|
@ -82,8 +83,8 @@ static BOOL deallocNotifications = NO;
|
||||||
static objc_mutex_t retain_counts_gate = NULL;
|
static objc_mutex_t retain_counts_gate = NULL;
|
||||||
|
|
||||||
#if GS_WITH_GC == 0 && !defined(NeXT_RUNTIME)
|
#if GS_WITH_GC == 0 && !defined(NeXT_RUNTIME)
|
||||||
#define REFCNT_LOCAL 0
|
#define REFCNT_LOCAL 1
|
||||||
#define CACHE_ZONE 0
|
#define CACHE_ZONE 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef ALIGN
|
#ifdef ALIGN
|
||||||
|
@ -225,12 +226,12 @@ NSDecrementExtraRefCountWasZero(id anObject)
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#define GSI_MAP_EQUAL(M, X, Y) (X.obj == Y.obj)
|
#define GSI_MAP_EQUAL(M, X, Y) (X.obj == Y.obj)
|
||||||
#define GSI_MAP_HASH(M, X) (X.ptr >> 2)
|
#define GSI_MAP_HASH(M, X) (X.uint >> 2)
|
||||||
#define GSI_MAP_RETAIN_KEY(M, X)
|
#define GSI_MAP_RETAIN_KEY(M, X)
|
||||||
#define GSI_MAP_RELEASE_KEY(M, X)
|
#define GSI_MAP_RELEASE_KEY(M, X)
|
||||||
#define GSI_MAP_RETAIN_VAL(M, X)
|
#define GSI_MAP_RETAIN_VAL(M, X)
|
||||||
#define GSI_MAP_RELEASE_VAL(M, X)
|
#define GSI_MAP_RELEASE_VAL(M, X)
|
||||||
#define GSI_MAP_KTYPES GSUNION_OBJ
|
#define GSI_MAP_KTYPES GSUNION_OBJ|GSUNION_INT
|
||||||
#define GSI_MAP_VTYPES GSUNION_INT
|
#define GSI_MAP_VTYPES GSUNION_INT
|
||||||
|
|
||||||
#include <base/GSIMap.h>
|
#include <base/GSIMap.h>
|
||||||
|
@ -253,7 +254,7 @@ NSIncrementExtraRefCount (id anObject)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GSIMapAddPair(&retain_count, (GSIMapKey)anObject, (GSIMapKey)1);
|
GSIMapAddPair(&retain_counts, (GSIMapKey)anObject, (GSIMapVal)1);
|
||||||
}
|
}
|
||||||
objc_mutex_unlock(retain_counts_gate);
|
objc_mutex_unlock(retain_counts_gate);
|
||||||
}
|
}
|
||||||
|
@ -266,7 +267,7 @@ NSIncrementExtraRefCount (id anObject)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GSIMapAddPair(&retain_count, (GSIMapKey)anObject, (GSIMapKey)1);
|
GSIMapAddPair(&retain_counts, (GSIMapKey)anObject, (GSIMapVal)1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -634,7 +635,8 @@ static BOOL double_release_check_enabled = NO;
|
||||||
fastMallocClass = [_FastMallocBuffer class];
|
fastMallocClass = [_FastMallocBuffer class];
|
||||||
#if GS_WITH_GC == 0
|
#if GS_WITH_GC == 0
|
||||||
#if !defined(REFCNT_LOCAL)
|
#if !defined(REFCNT_LOCAL)
|
||||||
GSIMapInitWithZoneAndCapacity(&retain-count, NSDefaultMallocZone(), 1024);
|
GSIMapInitWithZoneAndCapacity(&retain_counts,
|
||||||
|
NSDefaultMallocZone(), 1024);
|
||||||
#endif
|
#endif
|
||||||
fastMallocOffset = fastMallocClass->instance_size % ALIGN;
|
fastMallocOffset = fastMallocClass->instance_size % ALIGN;
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue