mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-20 12:16:40 +00:00
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:
parent
d2fa82f877
commit
43a0af2382
7 changed files with 54 additions and 7 deletions
|
@ -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];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue