after implementing a compare: method in PBIDMLine and replacing the
sortUsingKeyOrderArray: by sortUsingSelector:@selector(compare:) it works; the
memory consumption is back down to 57 MB. Thanks to all who helped!
btw. the sortUsingKeyOrderArray: wasn't from GNUStep, I guess it came from GDL;
it looked like that:
- (void) sortUsingKeyOrderArray: (NSArray *)orderArray
{
if ([self count] > 1)
{
[self sortUsingFunction:compareUsingSortOrderings context:orderArray];
}
}
static NSComparisonResult
compareUsingSortOrderings(id left,
id right,
void* vpSortOrders)
{
NSArray *sortOrders = (NSArray *)vpSortOrders;
NSComparisonResult r = NSOrderedSame;
unsigned int i;
unsigned int sortOrdCnt = [sortOrders count];
/* Loop over all sort orderings until we have an ordering difference. */
for (i=0; (r == NSOrderedSame) && (i < sortOrdCnt); i++){
PBSortOrdering *sortOrd = [sortOrders objectAtIndex: i];
NSString *key = [sortOrd key];
SEL compSel = [sortOrd selector];
id leftVal = [left valueForKeyPath: key];
id rightVal = [right valueForKeyPath: key];
NSComparisonResult (*imp)(id, SEL, id);
if(!leftVal && !rightVal)continue;
if(!leftVal)return NSOrderedAscending;
if(!rightVal)return NSOrderedDescending;
imp = (NSComparisonResult (*)(id, SEL, id))[leftVal methodForSelector:
compSel];
NSCAssert3(imp!=NULL,
@"Invalid comparison selector:%@ for object:<%@ 0x%x>",
NSStringFromSelector(compSel),
NSStringFromClass([leftVal class]),
leftVal);
r = (*imp)(leftVal, compSel, rightVal);
}
return r;
}
--
Pirmin Braun - IntarS Unternehmenssoftware GmbH - Sinziger Str. 29a - 53424
Remagen
+49 2642 308288 +49 174 9747584 - skype:pirminb www.intars.de [email protected]
intars.sourceforge.net
Geschäftsführer: Pirmin Braun, Ralf Engelhardt Registergericht: Amtsgericht
Coburg HRB3136
_______________________________________________
Gnustep-dev mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/gnustep-dev