mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 16:50:58 +00:00
explicitly use collectable memory
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27784 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
db77746841
commit
6516be5735
1 changed files with 15 additions and 2 deletions
|
@ -313,8 +313,13 @@ static GSIMapTable mapNew(NCTable *t)
|
||||||
{
|
{
|
||||||
GSIMapTable m;
|
GSIMapTable m;
|
||||||
|
|
||||||
|
#if GS_WITH_GC
|
||||||
|
m = NSAllocateCollectable(sizeof(GSIMapTable_t), NSScannedOption);
|
||||||
|
GSIMapInitWithZoneAndCapacity(m, GSIMapStrongKeyAndVal, 2);
|
||||||
|
#else
|
||||||
m = NSZoneMalloc(_zone, sizeof(GSIMapTable_t));
|
m = NSZoneMalloc(_zone, sizeof(GSIMapTable_t));
|
||||||
GSIMapInitWithZoneAndCapacity(m, _zone, 2);
|
GSIMapInitWithZoneAndCapacity(m, _zone, 2);
|
||||||
|
#endif
|
||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -400,15 +405,23 @@ static NCTable *newNCTable(void)
|
||||||
{
|
{
|
||||||
NCTable *t;
|
NCTable *t;
|
||||||
|
|
||||||
|
#if GS_WITH_GC
|
||||||
|
t = (NCTable*)NSAllocateCollectable(sizeof(NCTable), NSScannedOption);
|
||||||
|
#else
|
||||||
t = (NCTable*)NSZoneMalloc(_zone, sizeof(NCTable));
|
t = (NCTable*)NSZoneMalloc(_zone, sizeof(NCTable));
|
||||||
memset((void*)t, '\0', sizeof(NCTable));
|
memset((void*)t, '\0', sizeof(NCTable));
|
||||||
|
#endif
|
||||||
t->chunkIndex = CHUNKSIZE;
|
t->chunkIndex = CHUNKSIZE;
|
||||||
t->wildcard = ENDOBS;
|
t->wildcard = ENDOBS;
|
||||||
|
|
||||||
|
#if GS_WITH_GC
|
||||||
|
t->nameless = NSAllocateCollectable(sizeof(GSIMapTable_t), NSScannedOption);
|
||||||
|
t->named = NSAllocateCollectable(sizeof(GSIMapTable_t), NSScannedOption);
|
||||||
|
#else
|
||||||
t->nameless = NSZoneMalloc(_zone, sizeof(GSIMapTable_t));
|
t->nameless = NSZoneMalloc(_zone, sizeof(GSIMapTable_t));
|
||||||
GSIMapInitWithZoneAndCapacity(t->nameless, _zone, 16);
|
|
||||||
|
|
||||||
t->named = NSZoneMalloc(_zone, sizeof(GSIMapTable_t));
|
t->named = NSZoneMalloc(_zone, sizeof(GSIMapTable_t));
|
||||||
|
#endif
|
||||||
|
GSIMapInitWithZoneAndCapacity(t->nameless, _zone, 16);
|
||||||
GSIMapInitWithZoneAndCapacity(t->named, _zone, 128);
|
GSIMapInitWithZoneAndCapacity(t->named, _zone, 128);
|
||||||
|
|
||||||
// t->_lock = [GSLazyRecursiveLock new];
|
// t->_lock = [GSLazyRecursiveLock new];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue