Object stats
This adds some statistic for tracking
- How many deallocations are in message queues.
- How many allocators have been created.
- Per sizeclass statistics
- Number of objects allocated
- Number of objects deallocated
- Number of slabs allocated
- Number of slabs deallocated
The per sizeclass statistics are tracked per allocator, and a racy read is done to combine the results for displaying.
These statistics were used to debug #615 to calculate the fragmentation.
The displayed statistics are intended for post processing to calculate the fragmentation/utilisation.
The interface just prints the results using message. This could be improved with a better logging infrastructure.
Generally looks quite nice. ISTR
snmallocof old had the ability to conditionally keep stats or not; perhaps it would be worth having an empty implementation of theStatandMonotoneStatinterfaces and either templating or having anamespace snmalloc-scopedusingto pick between them?
I was going to profile to see how much the operations cost. If they are noticeable, then I will macro it away as you suggest.