MInor tidyup.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@16105 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-Macdonald 2003-03-02 07:47:18 +00:00
parent 7c4a383280
commit 3a344ae100
10 changed files with 64 additions and 52 deletions

View file

@ -61,12 +61,6 @@ extern BOOL __objc_responds_to(id, SEL);
#include <gc.h>
#include <gc_typed.h>
#else
@class _FastMallocBuffer;
static Class fastMallocClass;
static unsigned fastMallocOffset;
#endif
static Class NSConstantStringClass;
@ -812,12 +806,10 @@ static BOOL double_release_check_enabled = NO;
autorelease_sel = @selector(addObject:);
autorelease_imp = [autorelease_class methodForSelector: autorelease_sel];
#if GS_WITH_GC == 0
fastMallocClass = [_FastMallocBuffer class];
#if !defined(REFCNT_LOCAL)
GSIMapInitWithZoneAndCapacity(&retain_counts,
NSDefaultMallocZone(), 1024);
#endif
fastMallocOffset = fastMallocClass->instance_size % ALIGN;
#endif
NSConstantStringClass = [NSString constantStringClass];
GSBuildStrings();
@ -2114,37 +2106,6 @@ static BOOL double_release_check_enabled = NO;
@end
/*
* Stuff for temporary memory management.
*/
#if GS_WITH_GC == 0
@interface _FastMallocBuffer : NSObject
@end
@implementation _FastMallocBuffer
@end
#endif
/*
* Function for giving us the fastest possible allocation of memory to
* be used for temporary storage.
*/
void *
_fastMallocBuffer(unsigned size)
{
#if GS_WITH_GC
return GC_malloc(size);
#else
_FastMallocBuffer *o;
o = (_FastMallocBuffer*)NSAllocateObject(fastMallocClass,
size + fastMallocOffset, NSDefaultMallocZone());
(*autorelease_imp)(autorelease_class, autorelease_sel, o);
return ((void*)&o[1])+fastMallocOffset;
#endif
}
/*
* Stuff for compatibility with 'Object' derived classes.
*/