mirror of
https://github.com/gnustep/libs-gdl2.git
synced 2025-04-22 21:00:44 +00:00
* EOControl/EOMutableKnownKeyDictionary.h/m: Remove usage of GCObject.
* EOControl/EOFault.h/m: Ditto. * EOControl/EOFaultHandler.m: Ditto. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@24307 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
ca0fb8253e
commit
8e1c1d0374
6 changed files with 10 additions and 314 deletions
|
@ -21,7 +21,11 @@
|
|||
* Documentation/GDL2Intro/Examples/eoexample.m: Ditto
|
||||
* Documentation/GDL2Intro/Examples/connection.m: Ditto.
|
||||
* Documentation/GDL2Intro/Examples/library.eomodel: Ditto.
|
||||
|
||||
|
||||
* EOControl/EOMutableKnownKeyDictionary.h/m: Remove usage of GCObject.
|
||||
* EOControl/EOFault.h/m: Ditto.
|
||||
* EOControl/EOFaultHandler.m: Ditto.
|
||||
|
||||
2007-01-01 David Ayers <ayers@fsfe.org>
|
||||
|
||||
* EOAccess/EOAccessFault.h/m: Minor cleanups for autogsdoc.
|
||||
|
|
|
@ -37,9 +37,6 @@
|
|||
#include <Foundation/Foundation.h>
|
||||
#endif
|
||||
|
||||
#include <GNUstepBase/GCObject.h>
|
||||
|
||||
|
||||
@class NSInvocation;
|
||||
@class NSMethodSignature;
|
||||
@class NSDictionary;
|
||||
|
@ -119,34 +116,17 @@
|
|||
- (void)doesNotRecognizeSelector: (SEL)selector;
|
||||
- (void)forwardInvocation: (NSInvocation *)invocation;
|
||||
|
||||
- (id)gcSetNextObject: (id)object;
|
||||
- (id)gcSetPreviousObject: (id)object;
|
||||
- (id)gcNextObject;
|
||||
- (id)gcPreviousObject;
|
||||
- (BOOL)gcAlreadyVisited;
|
||||
- (void)gcSetVisited: (BOOL)flag;
|
||||
- (void)gcDecrementRefCountOfContainedObjects;
|
||||
- (BOOL)gcIncrementRefCountOfContainedObjects;
|
||||
- (BOOL)isGarbageCollectable;
|
||||
- (void)gcIncrementRefCount;
|
||||
- (void)gcDecrementRefCount;
|
||||
|
||||
@end /* EOFault */
|
||||
|
||||
|
||||
@interface EOFaultHandler : NSObject
|
||||
{
|
||||
gcInfo gc;
|
||||
|
||||
Class _targetClass; /* Cached class of original object. */
|
||||
void *_extraData; /* Cached memory contents of original object
|
||||
overwritten by fault handler reference. */
|
||||
|
||||
unsigned _extraRefCount;
|
||||
|
||||
BOOL gcEnabled;
|
||||
@public
|
||||
int gcCountainedObjectRefCount;
|
||||
}
|
||||
|
||||
- (void)setTargetClass: (Class)target extraData: (void *)data;
|
||||
|
@ -154,7 +134,7 @@
|
|||
- (void *)extraData;
|
||||
|
||||
- (void)incrementExtraRefCount;
|
||||
- (BOOL)decrementExtraRefCountWasZero;
|
||||
- (BOOL)decrementExtraRefCountIsZero;
|
||||
- (unsigned)extraRefCount;
|
||||
|
||||
- (NSString *)descriptionForObject: (id)object;
|
||||
|
@ -174,20 +154,6 @@
|
|||
|
||||
- (void)faultWillFire: (id)object;
|
||||
|
||||
// Garbage Collector
|
||||
|
||||
- (id)gcSetNextObject: (id)object;
|
||||
- (id)gcSetPreviousObject: (id)object;
|
||||
- (id)gcNextObject;
|
||||
- (id)gcPreviousObject;
|
||||
- (BOOL)gcAlreadyVisited;
|
||||
- (void)gcSetVisited: (BOOL)flag;
|
||||
- (void)gcDecrementRefCountOfContainedObjects;
|
||||
- (BOOL)gcIncrementRefCountOfContainedObjects;
|
||||
- (BOOL)isGarbageCollectable;
|
||||
- (void)gcIncrementRefCount;
|
||||
- (void)gcDecrementRefCount;
|
||||
|
||||
@end
|
||||
|
||||
#endif /* __EOFault_h__ */
|
||||
|
|
|
@ -203,8 +203,6 @@ static Class EOFaultClass = NULL;
|
|||
{
|
||||
EOFaultHandler *handler;
|
||||
EOFault *aFault = (EOFault *)fault;
|
||||
BOOL gcEnabled = NO;
|
||||
unsigned gcCountainedObjectRefCount = 0;
|
||||
int refs = 0;
|
||||
|
||||
NSDebugFLLog(@"gsdb", @"START fault=%p", fault);
|
||||
|
@ -229,8 +227,6 @@ static Class EOFaultClass = NULL;
|
|||
[handler faultWillFire: fault];
|
||||
|
||||
refs = [handler extraRefCount];
|
||||
gcEnabled = [handler isGarbageCollectable];
|
||||
gcCountainedObjectRefCount = aFault->_handler->gcCountainedObjectRefCount;
|
||||
|
||||
aFault->isa = [handler targetClass];
|
||||
aFault->_handler = [handler extraData];
|
||||
|
@ -245,16 +241,6 @@ static Class EOFaultClass = NULL;
|
|||
else
|
||||
while (refs++ < 0)
|
||||
[aFault release];
|
||||
|
||||
if(gcEnabled)
|
||||
{
|
||||
[aFault gcIncrementRefCount];
|
||||
[aFault gcSetNextObject: [self gcNextObject]];
|
||||
[aFault gcSetPreviousObject: [self gcPreviousObject]];
|
||||
|
||||
while (gcCountainedObjectRefCount-- > 0)
|
||||
[aFault gcIncrementRefCountOfContainedObjects];
|
||||
}
|
||||
}
|
||||
|
||||
NSDebugFLLog(@"gsdb", @"STOP fault=%p", fault);
|
||||
|
@ -381,7 +367,7 @@ static Class EOFaultClass = NULL;
|
|||
if ([_handler extraRefCount] <= 0)
|
||||
[self dealloc];
|
||||
else
|
||||
[_handler decrementExtraRefCountWasZero];
|
||||
[_handler decrementExtraRefCountIsZero];
|
||||
}
|
||||
|
||||
- autorelease
|
||||
|
@ -540,67 +526,4 @@ static Class EOFaultClass = NULL;
|
|||
return hash;
|
||||
}
|
||||
|
||||
// GC
|
||||
|
||||
- gcSetNextObject: (id)object
|
||||
{
|
||||
return [_handler gcSetNextObject: object];
|
||||
}
|
||||
|
||||
- gcSetPreviousObject: (id)object
|
||||
{
|
||||
return [_handler gcSetPreviousObject: object];
|
||||
}
|
||||
|
||||
- (id)gcNextObject
|
||||
{
|
||||
return [_handler gcNextObject];
|
||||
}
|
||||
|
||||
- (id)gcPreviousObject
|
||||
{
|
||||
return [_handler gcPreviousObject];
|
||||
}
|
||||
|
||||
- (BOOL)gcAlreadyVisited
|
||||
{
|
||||
return [_handler gcAlreadyVisited];
|
||||
}
|
||||
|
||||
- (void)gcSetVisited: (BOOL)flag
|
||||
{
|
||||
[_handler gcSetVisited: flag];
|
||||
}
|
||||
|
||||
- (void)gcDecrementRefCountOfContainedObjects
|
||||
{
|
||||
[_handler gcDecrementRefCountOfContainedObjects];
|
||||
}
|
||||
|
||||
- (BOOL)gcIncrementRefCountOfContainedObjects
|
||||
{
|
||||
return [_handler gcIncrementRefCountOfContainedObjects];
|
||||
}
|
||||
|
||||
- (BOOL)isGarbageCollectable
|
||||
{
|
||||
return [_handler isGarbageCollectable];
|
||||
}
|
||||
|
||||
- (void)gcIncrementRefCount
|
||||
{
|
||||
[_handler gcIncrementRefCount];
|
||||
}
|
||||
|
||||
- (void)gcDecrementRefCount
|
||||
{
|
||||
EOFLOGObjectLevelArgs(@"gsdb", @"START self=%p", self);
|
||||
|
||||
EOFLOGObjectLevel(@"gsdb", @"handler gcDecrementRefCount");
|
||||
|
||||
[_handler gcDecrementRefCount];
|
||||
|
||||
EOFLOGObjectLevelArgs(@"gsdb", @"STOP self=%p", self);
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
@ -54,8 +54,6 @@ RCS_ID("$Id$")
|
|||
#include <GNUstepBase/GSCategories.h>
|
||||
#endif
|
||||
|
||||
#include <GNUstepBase/GCObject.h>
|
||||
|
||||
#include <EOControl/EOFault.h>
|
||||
#include <EOControl/EODebug.h>
|
||||
|
||||
|
@ -65,34 +63,6 @@ RCS_ID("$Id$")
|
|||
|
||||
#include <objc/Protocol.h>
|
||||
|
||||
|
||||
BOOL __isGCEnabled(Class class_)
|
||||
{
|
||||
Class gcObjectClass = [GCObject class];
|
||||
|
||||
if ([class_ instancesRespondToSelector: @selector(gcIncrementRefCount)])
|
||||
return YES;
|
||||
else
|
||||
{
|
||||
Class class;
|
||||
|
||||
for (class = class_;
|
||||
class != Nil;
|
||||
class = class_get_super_class (class))
|
||||
{
|
||||
if (class == gcObjectClass)
|
||||
return YES;
|
||||
else if ([class instancesRespondToSelector: @selector(gcIncrementRefCount)])
|
||||
return YES;
|
||||
else if ([class instancesRespondToSelector: @selector(gcNextObject)])
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
|
||||
@implementation EOFaultHandler
|
||||
|
||||
- (id)init
|
||||
|
@ -109,11 +79,6 @@ BOOL __isGCEnabled(Class class_)
|
|||
{
|
||||
_targetClass = target;
|
||||
_extraData = data;
|
||||
|
||||
gcEnabled = __isGCEnabled(_targetClass);
|
||||
|
||||
if (gcEnabled)
|
||||
_extraRefCount++;
|
||||
}
|
||||
|
||||
- (Class)targetClass
|
||||
|
@ -131,7 +96,7 @@ BOOL __isGCEnabled(Class class_)
|
|||
_extraRefCount++;
|
||||
}
|
||||
|
||||
- (BOOL)decrementExtraRefCountWasZero
|
||||
- (BOOL)decrementExtraRefCountIsZero
|
||||
{
|
||||
if (!(--_extraRefCount))
|
||||
return YES;
|
||||
|
@ -246,149 +211,4 @@ BOOL __isGCEnabled(Class class_)
|
|||
return;
|
||||
}
|
||||
|
||||
// GC
|
||||
|
||||
+ allocWithZone: (NSZone *)zone_
|
||||
{
|
||||
id newObject = [super allocWithZone: zone_];
|
||||
|
||||
((EOFaultHandler *)newObject)->gc.flags.refCount = 0;
|
||||
|
||||
return newObject;
|
||||
}
|
||||
|
||||
/*
|
||||
- retain
|
||||
{
|
||||
if (gcEnabled)
|
||||
{
|
||||
gc.flags.refCount++;
|
||||
return self;
|
||||
}
|
||||
else
|
||||
{
|
||||
return [super retain];
|
||||
};
|
||||
}
|
||||
|
||||
- (unsigned int)retainCount
|
||||
{
|
||||
if (gcEnabled)
|
||||
{
|
||||
return gc.flags.refCount;
|
||||
}
|
||||
else
|
||||
{
|
||||
return [super retainCount];
|
||||
};
|
||||
}
|
||||
*/
|
||||
- gcSetNextObject: (id)anObject
|
||||
{
|
||||
if (gcEnabled)
|
||||
gc.next = anObject;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- gcSetPreviousObject: (id)anObject
|
||||
{
|
||||
if (gcEnabled)
|
||||
gc.previous = anObject;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (id)gcNextObject
|
||||
{
|
||||
if (gcEnabled)
|
||||
return gc.next;
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (id)gcPreviousObject
|
||||
{
|
||||
if (gcEnabled)
|
||||
return gc.previous;
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (BOOL)gcAlreadyVisited
|
||||
{
|
||||
if (gcEnabled)
|
||||
return gc.flags.visited;
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)gcSetVisited: (BOOL)flag
|
||||
{
|
||||
if (gcEnabled)
|
||||
gc.flags.visited = flag;
|
||||
}
|
||||
|
||||
- (void)gcDecrementRefCountOfContainedObjects
|
||||
{
|
||||
EOFLOGObjectFnStart();
|
||||
|
||||
if (gcEnabled)
|
||||
gcCountainedObjectRefCount--;
|
||||
|
||||
EOFLOGObjectFnStop();
|
||||
}
|
||||
|
||||
- (BOOL)gcIncrementRefCountOfContainedObjects
|
||||
{
|
||||
if (gcEnabled)
|
||||
{
|
||||
if (gc.flags.visited)
|
||||
return NO;
|
||||
|
||||
gcCountainedObjectRefCount++;
|
||||
gc.flags.visited = YES;
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (BOOL)isGarbageCollectable
|
||||
{
|
||||
return gcEnabled;
|
||||
}
|
||||
|
||||
- (void)gcIncrementRefCount
|
||||
{
|
||||
if (gcEnabled);
|
||||
//gc.flags.refCount++;
|
||||
// faultReferences++;
|
||||
}
|
||||
|
||||
- (void)gcDecrementRefCount
|
||||
{
|
||||
if(gcEnabled);
|
||||
//gc.flags.refCount--;
|
||||
// faultReferences--;
|
||||
}
|
||||
|
||||
/*
|
||||
- (BOOL)afterFault
|
||||
{
|
||||
if (gcEnabled)
|
||||
{
|
||||
[fault gcIncrementRefCount];
|
||||
fault->gc.next = gc.next;
|
||||
fault->gc.previous = gc.previous;
|
||||
while (gcCountainedObjectRefCount-- > 0)
|
||||
{
|
||||
[fault gcIncrementRefCountOfContainedObjects];
|
||||
}
|
||||
};
|
||||
return NO;
|
||||
}
|
||||
*/
|
||||
|
||||
@end
|
||||
|
|
|
@ -31,13 +31,11 @@
|
|||
#include <Foundation/NSObject.h>
|
||||
#include <Foundation/NSEnumerator.h>
|
||||
#include <Foundation/NSZone.h>
|
||||
#include <Foundation/NSMapTable.h>
|
||||
#else
|
||||
#include <Foundation/Foundation.h>
|
||||
#endif
|
||||
|
||||
#include <GNUstepBase/GCObject.h>
|
||||
|
||||
|
||||
@class NSArray;
|
||||
@class NSDictionary;
|
||||
@class NSMutableDictionary;
|
||||
|
@ -46,7 +44,7 @@
|
|||
@class EOMKKDArrayMapping;
|
||||
@class EOMKKDSubsetMapping;
|
||||
|
||||
@interface EOMKKDInitializer : GCObject
|
||||
@interface EOMKKDInitializer : NSObject
|
||||
{
|
||||
unsigned int _count;
|
||||
NSMapTable *_keyToIndex; //key to index
|
||||
|
|
|
@ -172,21 +172,6 @@ RCS_ID("$Id$")
|
|||
//EOFLogC("GSWElementIDString end of dealloc");
|
||||
}
|
||||
|
||||
- (void)gcDecrementRefCountOfContainedObjects
|
||||
{
|
||||
// [X gcDecrementRefCount];
|
||||
}
|
||||
|
||||
- (BOOL)gcIncrementRefCountOfContainedObjects
|
||||
{
|
||||
if (![super gcIncrementRefCountOfContainedObjects])
|
||||
return NO;
|
||||
|
||||
//[XX gcIncrementRefCount];
|
||||
//[XX gcIncrementRefCountOfContainedObjects];
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (NSString*)description
|
||||
{
|
||||
NSString *dscr;
|
||||
|
|
Loading…
Reference in a new issue