(setAutoreleaseClass, autoreleaseClass): New methods.

Temporarily disable forwardInvocation.
(autorelease_class): Make static.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@88 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Andrew McCallum 1995-03-12 19:29:37 +00:00
parent e493032afb
commit 03c747e1cf

View file

@ -76,7 +76,7 @@ NSObject *NSCopyObject(NSObject *anObject, unsigned extraBytes, NSZone *zone)
static coll_cache_ptr retain_counts = NULL; static coll_cache_ptr retain_counts = NULL;
/* The Class responsible for handling autorelease's */ /* The Class responsible for handling autorelease's */
id autorelease_class = nil; static id autorelease_class = nil;
BOOL NSShouldRetainWithZone(NSObject *anObject, NSZone *requestedZone) BOOL NSShouldRetainWithZone(NSObject *anObject, NSZone *requestedZone)
{ {
@ -154,7 +154,7 @@ BOOL NSDecrementExtraRefCountWasZero(id anObject)
- (void) dealloc - (void) dealloc
{ {
return NSDeallocateObject(self); NSDeallocateObject(self);
} }
- free - free
@ -250,16 +250,21 @@ BOOL NSDecrementExtraRefCountWasZero(id anObject)
- (retval_t) forward:(SEL)aSel :(arglist_t)argFrame - (retval_t) forward:(SEL)aSel :(arglist_t)argFrame
{ {
#if 1
[self doesNotRecognizeSelector:aSel];
return NULL;
#else
void *retFrame; void *retFrame;
NSMethodSignature *ms = [self methodSignatureForSelector:aSel]; NSMethodSignature *ms = [self methodSignatureForSelector:aSel];
NSInvocation *inv = [NSInvocation invocationWithMethodSignature:ms NSInvocation *inv = [NSInvocation invocationWithMethodSignature:ms
frame:argFrame]; frame:argFrame];
/* is this right? */ /* is this right? */
retFrame = (void*) alloc([ms methodReturnLength]); retFrame = (void*) alloca([ms methodReturnLength]);
[self forwardInvocation:inv]; [self forwardInvocation:inv];
[inv getReturnValue:retFrame]; [inv getReturnValue:retFrame];
/* where do ms and inv get free'd? */ /* where do ms and inv get free'd? */
return retFrame; return retFrame;
#endif
} }
- (void) forwardInvocation: (NSInvocation*)anInvocation - (void) forwardInvocation: (NSInvocation*)anInvocation
@ -501,12 +506,6 @@ BOOL NSDecrementExtraRefCountWasZero(id anObject)
return [self error:"method %s not implemented", sel_get_name(aSel)]; return [self error:"method %s not implemented", sel_get_name(aSel)];
} }
- shouldNotImplement:(SEL)aSel
{
return [self error:"%s should not implement %s",
object_get_class_name(self), sel_get_name(aSel)];
}
- doesNotRecognize:(SEL)aSel - doesNotRecognize:(SEL)aSel
{ {
return [self error:"%s does not recognize %s", return [self error:"%s does not recognize %s",
@ -519,6 +518,16 @@ BOOL NSDecrementExtraRefCountWasZero(id anObject)
/* GNU Object class compatibility */ /* GNU Object class compatibility */
+ (void) setAutoreleaseClass: (Class)aClass
{
autorelease_class = aClass;
}
+ (Class) autoreleaseClass
{
return autorelease_class;
}
- (int)compare:anotherObject; - (int)compare:anotherObject;
{ {
if ([self isEqual:anotherObject]) if ([self isEqual:anotherObject])
@ -585,6 +594,12 @@ BOOL NSDecrementExtraRefCountWasZero(id anObject)
return [self error:"subclass should override %s", sel_get_name(aSel)]; return [self error:"subclass should override %s", sel_get_name(aSel)];
} }
- shouldNotImplement:(SEL)aSel
{
return [self error:"%s should not implement %s",
object_get_class_name(self), sel_get_name(aSel)];
}
+ (int)streamVersion: (TypedStream*)aStream + (int)streamVersion: (TypedStream*)aStream
{ {
if (aStream->mode == OBJC_READONLY) if (aStream->mode == OBJC_READONLY)