Use NSZone functions for memory allocation

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@7780 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
richard 2000-10-10 19:47:54 +00:00
parent 72e4399351
commit 6c0137925a
3 changed files with 5 additions and 4 deletions

View file

@ -88,7 +88,8 @@ GSNumberInfoFromObject(NSNumber *o)
break; break;
} }
} }
info = (GSNumberInfo*)objc_malloc(sizeof(GSNumberInfo)); info = (GSNumberInfo*)NSZoneMalloc(NSDefaultMallocZone(),
(sizeof(GSNumberInfo)));
info->typeLevel = order; info->typeLevel = order;
info->getValue = (void (*)(NSNumber*, SEL, void*)) info->getValue = (void (*)(NSNumber*, SEL, void*))

View file

@ -149,7 +149,7 @@ typedef struct {
{ {
_isUnicode = NO; _isUnicode = NO;
_string = [GSCString_class allocWithZone: NSDefaultMallocZone()]; _string = [GSCString_class allocWithZone: NSDefaultMallocZone()];
_string = [_string initWithCString: ((ivars)aString)->_contents.u _string = [_string initWithCString: ((ivars)aString)->_contents.c
length: ((ivars)aString)->_count]; length: ((ivars)aString)->_count];
} }
} }

View file

@ -582,7 +582,7 @@ GSCheckTasks()
[args appendString: @" "]; [args appendString: @" "];
[args appendString: arg]; [args appendString: arg];
} }
c_args = objc_malloc([args cStringLength]+1); c_args = NSZoneMalloc(NSDefaultMallocZone(), [args cStringLength]+1);
[args getCString: c_args]; [args getCString: c_args];
memset (&start_info, 0, sizeof(start_info)); memset (&start_info, 0, sizeof(start_info));
@ -602,7 +602,7 @@ GSCheckTasks()
[[self currentDirectoryPath] fileSystemRepresentation], [[self currentDirectoryPath] fileSystemRepresentation],
&start_info, &start_info,
&proc_info); &proc_info);
objc_free(c_args); NSZoneFree(NSDefaultMallocZone(), c_args);
if (result == 0) if (result == 0)
{ {
NSLog(@"Error launching task: %@", lpath); NSLog(@"Error launching task: %@", lpath);