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:
richard 2000-07-03 11:47:17 +00:00
parent dae20769ac
commit 7617609b41
17 changed files with 745 additions and 379 deletions

View file

@ -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];