More GC updates

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@4959 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
richard 1999-09-29 20:15:17 +00:00
parent 9bdfdab11c
commit cc15f872ca
6 changed files with 222 additions and 104 deletions

View file

@ -185,7 +185,11 @@
{
_count = length;
_contents_chars = chars;
#if GS_WITH_GC
_zone = chars ? GSAtomicMallocZone() : 0;
#else
_zone = chars ? zone : 0;
#endif
}
return self;
}
@ -202,7 +206,11 @@
_contents_chars = chars;
if (flag && chars)
{
#if GS_WITH_GC
_zone = GSAtomicMallocZone();
#else
_zone = NSZoneFromPointer(chars);
#endif
}
else
{
@ -350,7 +358,11 @@
[aCoder decodeValueOfObjCType: @encode(unsigned) at: &_count];
if (_count)
{
#if GS_WITH_GC
_zone = GSAtomicMallocZone();
#else
_zone = fastZone(self);
#endif
_contents_chars = NSZoneMalloc(_zone, sizeof(unichar)*_count);
[aCoder decodeArrayOfObjCType: @encode(unichar)
count: _count
@ -585,7 +597,11 @@ stringDecrementCountAndFillHoleAt(NSGMutableStringStruct *self,
_count = length;
_capacity = length;
_contents_chars = chars;
#if GS_WITH_GC
_zone = _zone ? GSAtomicMallocZone() : 0;
#else
_zone = zone;
#endif
}
return self;
}
@ -602,7 +618,11 @@ stringDecrementCountAndFillHoleAt(NSGMutableStringStruct *self,
_contents_chars = chars;
if (flag && chars)
{
#if GS_WITH_GC
_zone = GSAtomicMallocZone();
#else
_zone = NSZoneFromPointer(chars);
#endif
}
else
{
@ -623,7 +643,11 @@ stringDecrementCountAndFillHoleAt(NSGMutableStringStruct *self,
}
_count = 0;
_capacity = capacity;
#if GS_WITH_GC
_zone = GSAtomicMallocZone();
#else
_zone = fastZone(self);
#endif
_contents_chars = NSZoneMalloc(_zone, sizeof(unichar)*capacity);
}
return self;