mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
More experimental code changes
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38801 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
841ddf78e0
commit
8e93dc85d3
5 changed files with 62 additions and 9 deletions
|
@ -29,6 +29,7 @@
|
|||
#import "common.h"
|
||||
|
||||
#import "Foundation/NSArray.h"
|
||||
#import "Foundation/NSAutoreleasePool.h"
|
||||
#import "Foundation/NSDictionary.h"
|
||||
#import "Foundation/NSEnumerator.h"
|
||||
#import "Foundation/NSException.h"
|
||||
|
@ -1065,6 +1066,30 @@ const NSHashTableCallBacks NSPointerToStructHashCallBacks =
|
|||
}
|
||||
}
|
||||
|
||||
- (NSUInteger) sizeInBytes: (NSHashTable*)exclude
|
||||
{
|
||||
NSUInteger size = [super sizeInBytes: 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];
|
||||
}
|
||||
}
|
||||
return size;
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation NSConcreteHashTableEnumerator
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue