Implement -sizeInBytesExcluding: on GSFIFO

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/performance/trunk@38809 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Niels Grewe 2015-07-16 12:57:56 +00:00
parent 3859653420
commit 74d1c92669
2 changed files with 21 additions and 1 deletions

View file

@ -1,3 +1,7 @@
2015-07-16 Niels Grewe <niels.grewe@halbordnung.de>
* GSFIFO.m: Implement -sizeInBytesExcluding:
2015-07-15 Richard Frith-Macdonald <rfm@gnu.org>
* GSCache.m: Experimental change (use in conjunction with gnustep-base

View file

@ -209,7 +209,7 @@ stats(NSTimeInterval ti, uint32_t max, NSTimeInterval *bounds, uint64_t *bands)
// We do not need to signal the condition because
// nothing about the qeuue did change
[condition unlock];
return NULL;;
return NULL;
}
void *ptr = _items[_tail % _capacity];
[condition unlock];
@ -900,5 +900,21 @@ stats(NSTimeInterval ti, uint32_t max, NSTimeInterval *bounds, uint64_t *bands)
return NO;
}
- (NSUInteger)sizeInBytesExcluding: (NSHashTable*)excluding
{
NSUInteger size = 0;
if (0 == (size = [super sizeInBytesExcluding: excluding]))
{
return 0;
}
return size
+ (_capacity * sizeof(void)) // item storage
+ (boundsCount * sizeof(NSTimeInterval)) // boundaries
+ (2 * (boundsCount + 1) * sizeof(uint64_t)) // get and put counts
+ [condition sizeInBytesExcluding: excluding]
+ [name sizeInBytesExcluding: excluding]
+ [putThread sizeInBytesExcluding: excluding]
+ [getThread sizeInBytesExcluding: excluding];
}
@end