more updates

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38803 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2015-07-16 08:44:15 +00:00
parent 46d97b3be0
commit 3b02814665
19 changed files with 138 additions and 119 deletions

View file

@ -1066,27 +1066,25 @@ const NSHashTableCallBacks NSPointerToStructHashCallBacks =
}
}
- (NSUInteger) sizeInBytes: (NSHashTable*)exclude
- (NSUInteger) sizeInBytesExcluding: (NSHashTable*)exclude
{
NSUInteger size = [super sizeInBytes: exclude];
NSUInteger size = [super sizeInBytesExcluding: exclude];
if (size > 0)
{
NSUInteger count = [self count];
size += GSIMapSize(self);
if (count > 0)
{
NSAutoreleasePool *pool = [NSAutoreleasePool new];
NSEnumerator *enumerator = [self objectEnumerator];
NSObject *o;
while ((o = [enumerator nextObject]) != nil)
{
size += [o sizeInBytes: exclude];
}
[pool release];
}
/* If we knew that this table held objects, we could return their size...
*
* GSIMapEnumerator_t enumerator = GSIMapEnumeratorForMap(self);
* GSIMapNode node = GSIMapEnumeratorNextNode(&enumerator);
*
* while (node != 0)
* {
* node = GSIMapEnumeratorNextNode(&enumerator);
* size += [node->key.obj sizeInBytesExcluding: exclude];
* }
* GSIMapEndEnumerator(&enumerator);
*/
size += GSIMapSize(self) - sizeof(GSI_MAP_TABLE_T);
}
return size;
}