mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
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:
parent
cd50020ae6
commit
46644b7779
3 changed files with 5 additions and 4 deletions
|
@ -88,7 +88,8 @@ GSNumberInfoFromObject(NSNumber *o)
|
|||
break;
|
||||
}
|
||||
}
|
||||
info = (GSNumberInfo*)objc_malloc(sizeof(GSNumberInfo));
|
||||
info = (GSNumberInfo*)NSZoneMalloc(NSDefaultMallocZone(),
|
||||
(sizeof(GSNumberInfo)));
|
||||
info->typeLevel = order;
|
||||
|
||||
info->getValue = (void (*)(NSNumber*, SEL, void*))
|
||||
|
|
|
@ -149,7 +149,7 @@ typedef struct {
|
|||
{
|
||||
_isUnicode = NO;
|
||||
_string = [GSCString_class allocWithZone: NSDefaultMallocZone()];
|
||||
_string = [_string initWithCString: ((ivars)aString)->_contents.u
|
||||
_string = [_string initWithCString: ((ivars)aString)->_contents.c
|
||||
length: ((ivars)aString)->_count];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -582,7 +582,7 @@ GSCheckTasks()
|
|||
[args appendString: @" "];
|
||||
[args appendString: arg];
|
||||
}
|
||||
c_args = objc_malloc([args cStringLength]+1);
|
||||
c_args = NSZoneMalloc(NSDefaultMallocZone(), [args cStringLength]+1);
|
||||
[args getCString: c_args];
|
||||
|
||||
memset (&start_info, 0, sizeof(start_info));
|
||||
|
@ -602,7 +602,7 @@ GSCheckTasks()
|
|||
[[self currentDirectoryPath] fileSystemRepresentation],
|
||||
&start_info,
|
||||
&proc_info);
|
||||
objc_free(c_args);
|
||||
NSZoneFree(NSDefaultMallocZone(), c_args);
|
||||
if (result == 0)
|
||||
{
|
||||
NSLog(@"Error launching task: %@", lpath);
|
||||
|
|
Loading…
Reference in a new issue