mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
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:
parent
8af37de38b
commit
3efbfa42e2
17 changed files with 428 additions and 16 deletions
|
@ -1087,6 +1087,16 @@ tsbytes(uintptr_t s, char *buf)
|
|||
{
|
||||
return;
|
||||
}
|
||||
|
||||
- (NSUInteger) sizeInBytes: (NSHashTable*)exclude
|
||||
{
|
||||
if (0 == NSMapGet(exclude, self))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return 8;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
|
@ -3834,6 +3844,21 @@ transmute(GSStr self, NSString *aString)
|
|||
freeWhenDone: flag];
|
||||
}
|
||||
|
||||
- (NSUInteger) sizeInBytes: (NSHashTable*)exclude
|
||||
{
|
||||
NSUInteger size = GSPrivateMemorySize(self, exclude);
|
||||
|
||||
if (size > 0 && _flags.owned)
|
||||
{
|
||||
size += _count;
|
||||
if (_flags.wide)
|
||||
{
|
||||
size += _count;
|
||||
}
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
@ -5640,6 +5665,21 @@ NSAssert(_flags.owned == 1 && _zone != 0, NSInternalInconsistencyException);
|
|||
return _count;
|
||||
}
|
||||
|
||||
- (NSUInteger) sizeInBytes: (NSHashTable*)exclude
|
||||
{
|
||||
NSUInteger size = GSPrivateMemorySize(self, exclude);
|
||||
|
||||
if (size > 0 && _flags.owned)
|
||||
{
|
||||
size += _capacity;
|
||||
if (_flags.wide)
|
||||
{
|
||||
size += _capacity;
|
||||
}
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue