mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-01 09:02:01 +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
3efbfa42e2
commit
a8132a27d5
5 changed files with 62 additions and 9 deletions
|
@ -406,12 +406,12 @@ static GC_descr nodeDesc; // Type descriptor for map node.
|
||||||
if (count > 0)
|
if (count > 0)
|
||||||
{
|
{
|
||||||
NSAutoreleasePool *pool = [NSAutoreleasePool new];
|
NSAutoreleasePool *pool = [NSAutoreleasePool new];
|
||||||
NSEnumerator *enumerator = [self keyEnumerator];
|
NSEnumerator *enumerator = [self objectEnumerator];
|
||||||
NSObject *k;
|
NSObject *o;
|
||||||
|
|
||||||
while ((k = [enumerator nextObject]) != nil)
|
while ((o = [enumerator nextObject]) != nil)
|
||||||
{
|
{
|
||||||
size += [k sizeInBytes: exclude];
|
size += [o sizeInBytes: exclude];
|
||||||
}
|
}
|
||||||
[pool release];
|
[pool release];
|
||||||
}
|
}
|
||||||
|
|
|
@ -550,12 +550,12 @@ static Class mutableSetClass;
|
||||||
if (count > 0)
|
if (count > 0)
|
||||||
{
|
{
|
||||||
NSAutoreleasePool *pool = [NSAutoreleasePool new];
|
NSAutoreleasePool *pool = [NSAutoreleasePool new];
|
||||||
NSEnumerator *enumerator = [self keyEnumerator];
|
NSEnumerator *enumerator = [self objectEnumerator];
|
||||||
NSObject *k;
|
NSObject *o;
|
||||||
|
|
||||||
while ((k = [enumerator nextObject]) != nil)
|
while ((o = [enumerator nextObject]) != nil)
|
||||||
{
|
{
|
||||||
size += [k sizeInBytes: exclude];
|
size += [o sizeInBytes: exclude];
|
||||||
}
|
}
|
||||||
[pool release];
|
[pool release];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1090,7 +1090,7 @@ tsbytes(uintptr_t s, char *buf)
|
||||||
|
|
||||||
- (NSUInteger) sizeInBytes: (NSHashTable*)exclude
|
- (NSUInteger) sizeInBytes: (NSHashTable*)exclude
|
||||||
{
|
{
|
||||||
if (0 == NSMapGet(exclude, self))
|
if (0 == NSHashGet(exclude, self))
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#import "common.h"
|
#import "common.h"
|
||||||
|
|
||||||
#import "Foundation/NSArray.h"
|
#import "Foundation/NSArray.h"
|
||||||
|
#import "Foundation/NSAutoreleasePool.h"
|
||||||
#import "Foundation/NSDictionary.h"
|
#import "Foundation/NSDictionary.h"
|
||||||
#import "Foundation/NSEnumerator.h"
|
#import "Foundation/NSEnumerator.h"
|
||||||
#import "Foundation/NSException.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
|
@end
|
||||||
|
|
||||||
@implementation NSConcreteHashTableEnumerator
|
@implementation NSConcreteHashTableEnumerator
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#import "common.h"
|
#import "common.h"
|
||||||
|
|
||||||
#import "Foundation/NSArray.h"
|
#import "Foundation/NSArray.h"
|
||||||
|
#import "Foundation/NSAutoreleasePool.h"
|
||||||
#import "Foundation/NSDictionary.h"
|
#import "Foundation/NSDictionary.h"
|
||||||
#import "Foundation/NSEnumerator.h"
|
#import "Foundation/NSEnumerator.h"
|
||||||
#import "Foundation/NSException.h"
|
#import "Foundation/NSException.h"
|
||||||
|
@ -1429,6 +1430,33 @@ const NSMapTableValueCallBacks NSOwnedPointerMapValueCallBacks =
|
||||||
p->_x = self->cb.pf.v;
|
p->_x = self->cb.pf.v;
|
||||||
return [p autorelease];
|
return [p autorelease];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (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 keyEnumerator];
|
||||||
|
NSObject *k;
|
||||||
|
|
||||||
|
while ((k = [enumerator nextObject]) != nil)
|
||||||
|
{
|
||||||
|
NSObject *o = [self objectForKey: k];
|
||||||
|
|
||||||
|
size += [k sizeInBytes: exclude] + [o sizeInBytes: exclude];
|
||||||
|
}
|
||||||
|
[pool release];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return size;
|
||||||
|
}
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation NSConcreteMapTableKeyEnumerator
|
@implementation NSConcreteMapTableKeyEnumerator
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue