mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
Improved memory usage reporting mechanisms
This commit is contained in:
parent
2ca4f74af5
commit
dd36855923
21 changed files with 404 additions and 230 deletions
|
@ -814,26 +814,11 @@ const NSHashTableCallBacks NSPointerToStructHashCallBacks =
|
|||
|
||||
@implementation NSConcreteHashTable
|
||||
|
||||
+ (NSUInteger) contentSizeOf: (NSObject*)obj
|
||||
declaredIn: (Class)cls
|
||||
excluding: (NSHashTable*)exclude
|
||||
- (NSUInteger) sizeOfContentExcluding: (NSHashTable*)exclude
|
||||
{
|
||||
GSIMapTable map = (GSIMapTable)obj;
|
||||
NSUInteger size = GSIMapSize(map) - sizeof(GSIMapTable);
|
||||
|
||||
/* If we knew that this table held objects, we could return their size...
|
||||
|
||||
GSIMapEnumerator_t enumerator = GSIMapEnumeratorForMap(map);
|
||||
GSIMapNode node = GSIMapEnumeratorNextNode(&enumerator);
|
||||
|
||||
while (node != 0)
|
||||
{
|
||||
size += [node->key.obj sizeInBytesExcluding: exclude];
|
||||
node = GSIMapEnumeratorNextNode(&enumerator);
|
||||
}
|
||||
GSIMapEndEnumerator(&enumerator);
|
||||
*/
|
||||
return size;
|
||||
/* Can't safely calculate for mutable object; just buffer size
|
||||
*/
|
||||
return nodeCount * sizeof(GSIMapNode);
|
||||
}
|
||||
|
||||
+ (void) initialize
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue