GC improvements

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@27848 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2009-02-11 17:33:31 +00:00
parent d2fa82f877
commit 43a0af2382
7 changed files with 54 additions and 7 deletions

View file

@ -894,8 +894,13 @@ handle_printf_atsign (FILE *stream,
}
else
{
void *buf = NSZoneMalloc(GSObjCZone(self), length);
void *buf;
#if GS_WITH_GC
buf = NSAllocateCollectable(length, 0);
#else
buf = NSZoneMalloc(GSObjCZone(self), length);
#endif
memcpy(buf, bytes, length);
return [self initWithBytesNoCopy: buf
length: length
@ -4615,7 +4620,11 @@ static NSFileManager *fm = nil;
{
unsigned char *chars;
#if GS_WITH_GC
chars = NSAllocateCollectable(count+1, 0);
#else
chars = NSZoneMalloc(zone, count+1);
#endif
[aCoder decodeArrayOfObjCType: @encode(unsigned char)
count: count
at: chars];