wavelength 1.0.0
Loading...
Searching...
No Matches
MemStats.h
Go to the documentation of this file.
1#pragma once
2
3#include "utl/BlockStat.h"
4
10class BlockStatTable {
11public:
13 enum { kMaxStats = 1024 };
14
21 explicit BlockStatTable(bool separateSizes);
22
28 void Clear();
29
38
47 void Update(const char *name, int sizeReq, int sizeActual);
48
54 void SortBySize();
55
61 void SortByName();
62
68 int NumStats() const {
69 return mNumStats;
70 }
71
72private:
73 BlockStat mStats[kMaxStats];
74 int mMaxStats;
75 int mNumStats;
76 bool mSeparateSizes;
77};
Table of allocation totals by tag, filled from a HeapTracker for a report.
Definition blockstattable.h:21
void SortBySize()
Sort the totals by bytes allocated, largest first.
BlockStatTable(bool separateSizes)
Create an empty table.
@ kMaxStats
Definition MemStats.h:13
void Update(const char *name, int sizeReq, int sizeActual)
Add an allocation to the total of its name, starting a total when none matches.
void Clear()
Empty the table.
void SortByName()
Sort the totals by name.
BlockStat & GetBlockStat(int iStat)
Report a total.
int NumStats() const
Report the number of totals.
Definition MemStats.h:68
Totals of the tracked allocations of one tag.
Definition blockstattable.h:8