mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 08:21:25 +00:00
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:
parent
46d97b3be0
commit
3b02814665
19 changed files with 138 additions and 119 deletions
|
@ -34,6 +34,8 @@
|
|||
|
||||
#import "GNUstepBase/GSObjCRuntime.h"
|
||||
|
||||
#import "GSPrivate.h"
|
||||
|
||||
/*
|
||||
* The 'Fastmap' stuff provides an inline implementation of a mapping
|
||||
* table - for maximum performance.
|
||||
|
@ -365,29 +367,23 @@ static SEL objSel;
|
|||
(&map, state, stackbuf, len);
|
||||
}
|
||||
|
||||
- (NSUInteger) sizeInBytes: (NSHashTable*)exclude
|
||||
- (NSUInteger) sizeInBytesExcluding: (NSHashTable*)exclude
|
||||
{
|
||||
NSUInteger size = GSPrivateMemorySize(self, exclude);
|
||||
|
||||
if (size > 0)
|
||||
{
|
||||
NSUInteger count = [self count];
|
||||
GSIMapEnumerator_t enumerator = GSIMapEnumeratorForMap(&map);
|
||||
GSIMapNode node = GSIMapEnumeratorNextNode(&enumerator);
|
||||
|
||||
size += GSIMapSize(&map) - sizeof(map);
|
||||
if (count > 0)
|
||||
while (node != 0)
|
||||
{
|
||||
NSAutoreleasePool *pool = [NSAutoreleasePool new];
|
||||
NSEnumerator *enumerator = [self keyEnumerator];
|
||||
NSObject *k;
|
||||
|
||||
while ((k = [enumerator nextObject]) != nil)
|
||||
{
|
||||
NSObject *o = [self objectForKey: k];
|
||||
|
||||
size += [k sizeInBytes: exclude] + [o sizeInBytes: exclude];
|
||||
}
|
||||
[pool release];
|
||||
}
|
||||
node = GSIMapEnumeratorNextNode(&enumerator);
|
||||
size += [node->key.obj sizeInBytesExcluding: exclude];
|
||||
size += [node->value.obj sizeInBytesExcluding: exclude];
|
||||
}
|
||||
GSIMapEndEnumerator(&enumerator);
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue