mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
Massive tidy up
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@6862 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
dae20769ac
commit
7617609b41
17 changed files with 745 additions and 379 deletions
|
@ -107,6 +107,7 @@
|
|||
* these are set up at process startup or in [NSData +initialize]
|
||||
*/
|
||||
static SEL appendSel = @selector(appendBytes:length:);
|
||||
static Class dataStatic;
|
||||
static Class dataMalloc;
|
||||
static Class mutableDataMalloc;
|
||||
static IMP appendImp;
|
||||
|
@ -326,6 +327,7 @@ failure:
|
|||
if (self == [NSData class])
|
||||
{
|
||||
dataMalloc = [NSDataMalloc class];
|
||||
dataStatic = [NSDataStatic class];
|
||||
mutableDataMalloc = [NSMutableDataMalloc class];
|
||||
appendImp = [mutableDataMalloc instanceMethodForSelector: appendSel];
|
||||
}
|
||||
|
@ -397,6 +399,15 @@ failure:
|
|||
return AUTORELEASE(d);
|
||||
}
|
||||
|
||||
+ (id) new
|
||||
{
|
||||
NSData *d;
|
||||
|
||||
d = [dataMalloc allocWithZone: NSDefaultMallocZone()];
|
||||
d = [d initWithBytesNoCopy: 0 length: 0 fromZone: NSDefaultMallocZone()];
|
||||
return d;
|
||||
}
|
||||
|
||||
- (id) init
|
||||
{
|
||||
return [self initWithBytesNoCopy: 0 length: 0];
|
||||
|
@ -1335,6 +1346,15 @@ failure:
|
|||
return AUTORELEASE(d);
|
||||
}
|
||||
|
||||
+ (id) new
|
||||
{
|
||||
NSMutableData *d;
|
||||
|
||||
d = [mutableDataMalloc allocWithZone: NSDefaultMallocZone()];
|
||||
d = [d initWithCapacity: 0];
|
||||
return d;
|
||||
}
|
||||
|
||||
- (const void*) bytes
|
||||
{
|
||||
return [self mutableBytes];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue