memory usage interrogation

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38799 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2015-07-15 14:14:21 +00:00
parent 1ab490d19a
commit 841ddf78e0
17 changed files with 428 additions and 16 deletions

View file

@ -387,6 +387,7 @@ static Class GSInlineArrayClass;
state->state += count;
return count;
}
@end
#if !GS_WITH_GC
@ -970,6 +971,23 @@ static Class GSInlineArrayClass;
state->itemsPtr = stackbuf;
return count;
}
- (NSUInteger) sizeInBytes: (NSHashTable*)exclude
{
NSUInteger size = GSPrivateMemorySize(self, exclude);
if (size > 0)
{
NSUInteger count = _count;
size += _capacity*sizeof(void*);
while (count-- > 0)
{
size += [[self objectAtIndex: count] sizeInBytes: exclude];
}
}
return size;
}
@end