mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
(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:
parent
b3e5e87862
commit
875e72b4de
1 changed files with 24 additions and 9 deletions
|
@ -76,7 +76,7 @@ NSObject *NSCopyObject(NSObject *anObject, unsigned extraBytes, NSZone *zone)
|
|||
static coll_cache_ptr retain_counts = NULL;
|
||||
|
||||
/* The Class responsible for handling autorelease's */
|
||||
id autorelease_class = nil;
|
||||
static id autorelease_class = nil;
|
||||
|
||||
BOOL NSShouldRetainWithZone(NSObject *anObject, NSZone *requestedZone)
|
||||
{
|
||||
|
@ -154,7 +154,7 @@ BOOL NSDecrementExtraRefCountWasZero(id anObject)
|
|||
|
||||
- (void) dealloc
|
||||
{
|
||||
return NSDeallocateObject(self);
|
||||
NSDeallocateObject(self);
|
||||
}
|
||||
|
||||
- free
|
||||
|
@ -250,16 +250,21 @@ BOOL NSDecrementExtraRefCountWasZero(id anObject)
|
|||
|
||||
- (retval_t) forward:(SEL)aSel :(arglist_t)argFrame
|
||||
{
|
||||
#if 1
|
||||
[self doesNotRecognizeSelector:aSel];
|
||||
return NULL;
|
||||
#else
|
||||
void *retFrame;
|
||||
NSMethodSignature *ms = [self methodSignatureForSelector:aSel];
|
||||
NSInvocation *inv = [NSInvocation invocationWithMethodSignature:ms
|
||||
frame:argFrame];
|
||||
/* is this right? */
|
||||
retFrame = (void*) alloc([ms methodReturnLength]);
|
||||
retFrame = (void*) alloca([ms methodReturnLength]);
|
||||
[self forwardInvocation:inv];
|
||||
[inv getReturnValue:retFrame];
|
||||
/* where do ms and inv get free'd? */
|
||||
return retFrame;
|
||||
#endif
|
||||
}
|
||||
|
||||
- (void) forwardInvocation: (NSInvocation*)anInvocation
|
||||
|
@ -501,12 +506,6 @@ BOOL NSDecrementExtraRefCountWasZero(id anObject)
|
|||
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
|
||||
{
|
||||
return [self error:"%s does not recognize %s",
|
||||
|
@ -519,6 +518,16 @@ BOOL NSDecrementExtraRefCountWasZero(id anObject)
|
|||
|
||||
/* GNU Object class compatibility */
|
||||
|
||||
+ (void) setAutoreleaseClass: (Class)aClass
|
||||
{
|
||||
autorelease_class = aClass;
|
||||
}
|
||||
|
||||
+ (Class) autoreleaseClass
|
||||
{
|
||||
return autorelease_class;
|
||||
}
|
||||
|
||||
- (int)compare:anotherObject;
|
||||
{
|
||||
if ([self isEqual:anotherObject])
|
||||
|
@ -585,6 +594,12 @@ BOOL NSDecrementExtraRefCountWasZero(id anObject)
|
|||
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
|
||||
{
|
||||
if (aStream->mode == OBJC_READONLY)
|
||||
|
|
Loading…
Reference in a new issue