mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
Minor performance improvements.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@3209 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
7e2d21836f
commit
acaae6854e
5 changed files with 217 additions and 117 deletions
|
@ -26,7 +26,6 @@
|
|||
#include <config.h>
|
||||
#include <gnustep/base/preface.h>
|
||||
#include <Foundation/NSString.h>
|
||||
#include <Foundation/NSData.h>
|
||||
#include <Foundation/NSCoder.h>
|
||||
#include <gnustep/base/NSGString.h>
|
||||
#include <gnustep/base/NSGCString.h>
|
||||
|
@ -299,11 +298,10 @@ static IMP msInitImp; /* designated initialiser for mutable */
|
|||
|
||||
- (const char *) cString
|
||||
{
|
||||
char *r = NSZoneMalloc(NSDefaultMallocZone(), _count+1);
|
||||
char *r = (char*)_fastMallocBuffer(_count+1);
|
||||
|
||||
memcpy(r, _contents_chars, _count);
|
||||
r[_count] = '\0';
|
||||
[NSData dataWithBytesNoCopy:r length: _count+1];
|
||||
return r;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue