wavelength 1.0.0
Loading...
Searching...
No Matches
BlockStatTable Class Reference

Table of allocation totals by tag, filled from a HeapTracker for a report. More...

#include <blockstattable.h>

Public Types

enum  { kMaxStats = 1024 }
 Capacity of the table. More...

Public Member Functions

 BlockStatTable (int bSeparateSizes)
 Construct an empty table.
void Clear ()
 Empty the table.
BlockStat * GetStat (int nIndex)
 Report a row.
void Update (const char *pszName, int nRequested, int nActual)
 Add an allocation to the row of its tag, adding the row when the tag is new.
void SortBySize ()
 Sort the rows by bytes handed out, largest first.
void SortByName ()
 Sort the rows by tag.
int GetCount () const
 BlockStatTable (bool separateSizes)
 Create an empty table.
void Clear ()
 Empty the table.
BlockStat & GetBlockStat (int iStat)
 Report a total.
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 SortBySize ()
 Sort the totals by bytes allocated, largest first.
void SortByName ()
 Sort the totals by name.
int NumStats () const
 Report the number of totals.

Static Public Member Functions

static void * operator new (size_t nSize)
 Take a table from the memory tracker's own region.
static void operator delete (void *) noexcept
 Ignore the release of a table.
static void PrintDelta (PrnStream &stream, BlockStatTable *pCurrent, BlockStatTable *pPrevious)
 Write the differences between the rows of two tables sorted by tag.

Static Public Attributes

static constexpr int kCapacity = 1024
 The rows a table has room for.

Detailed Description

Table of allocation totals by tag, filled from a HeapTracker for a report.

Table of per-name allocation totals.

The class is not polymorphic. The name is the one the overflow warning gives.

The object is 0x500c bytes. The name comes from the message Update() fails with.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Capacity of the table.

Enumerator
kMaxStats 

Constructor & Destructor Documentation

◆ BlockStatTable() [1/2]

BlockStatTable::BlockStatTable ( int bSeparateSizes)
explicit

Construct an empty table.

Parameters
bSeparateSizesNon-zero to give each request size of a tag a separate row.
Ghidra address:
NTSC-U/C: 0x0029c7b0
Ghidra address:
PAL: 0x002a63d8

◆ BlockStatTable() [2/2]

BlockStatTable::BlockStatTable ( bool separateSizes)
explicit

Create an empty table.

Parameters
separateSizesWhether allocations of one name and different sizes get separate totals.
Ghidra address:
0x1001ab70

Member Function Documentation

◆ operator new()

void * BlockStatTable::operator new ( size_t nSize)
static

Take a table from the memory tracker's own region.

Parameters
nSizeThe size of the table.
Returns
The table.

◆ operator delete()

void BlockStatTable::operator delete ( void * )
inlinestaticnoexcept

Ignore the release of a table.

The memory tracker's region never takes memory back.

◆ Clear() [1/2]

void BlockStatTable::Clear ( )

Empty the table.

Ghidra address:
NTSC-U/C: 0x0029c7c8
Ghidra address:
PAL: 0x002a63f0

◆ GetStat()

BlockStat * BlockStatTable::GetStat ( int nIndex)

Report a row.

Parameters
nIndexThe row.
Returns
The row.
Ghidra address:
NTSC-U/C: 0x0029c7d0
Ghidra address:
PAL: 0x002a63f8

◆ Update() [1/2]

void BlockStatTable::Update ( const char * pszName,
int nRequested,
int nActual )

Add an allocation to the row of its tag, adding the row when the tag is new.

A full table reports an overflow through DebugWarn().

Parameters
pszNameThe tag.
nRequestedThe bytes requested.
nActualThe bytes handed out.
Ghidra address:
NTSC-U/C: 0x0029c7e0
Ghidra address:
PAL: 0x002a6408

◆ SortBySize() [1/2]

void BlockStatTable::SortBySize ( )

Sort the rows by bytes handed out, largest first.

Ghidra address:
NTSC-U/C: 0x0029c980
Ghidra address:
PAL: 0x002a65a8

◆ SortByName() [1/2]

void BlockStatTable::SortByName ( )

Sort the rows by tag.

Ghidra address:
NTSC-U/C: 0x0029c9b0
Ghidra address:
PAL: 0x002a65d8

◆ PrintDelta()

void BlockStatTable::PrintDelta ( PrnStream & stream,
BlockStatTable * pCurrent,
BlockStatTable * pPrevious )
static

Write the differences between the rows of two tables sorted by tag.

Rows past the end of the shorter table are left out.

Parameters
streamThe stream to write to.
pCurrentThe newer table.
pPreviousThe older table.
Ghidra address:
NTSC-U/C: 0x0029c110
Ghidra address:
PAL: 0x002a5d30

◆ GetCount()

int BlockStatTable::GetCount ( ) const
inline
Returns
The rows in use.

◆ Clear() [2/2]

void BlockStatTable::Clear ( )

Empty the table.

Ghidra address:
0x1001aba0

◆ GetBlockStat()

BlockStat & BlockStatTable::GetBlockStat ( int iStat)

Report a total.

Parameters
iStatThe total's index.
Returns
The total.
Ghidra address:
0x1001abb0

◆ Update() [2/2]

void BlockStatTable::Update ( const char * name,
int sizeReq,
int sizeActual )

Add an allocation to the total of its name, starting a total when none matches.

Parameters
nameThe allocation's name.
sizeReqThe bytes requested.
sizeActualThe bytes allocated.
Ghidra address:
0x1001abf0

◆ SortBySize() [2/2]

void BlockStatTable::SortBySize ( )

Sort the totals by bytes allocated, largest first.

Ghidra address:
0x1001ad50

◆ SortByName() [2/2]

void BlockStatTable::SortByName ( )

Sort the totals by name.

Ghidra address:
0x1001b0c0

◆ NumStats()

int BlockStatTable::NumStats ( ) const
inline

Report the number of totals.

Returns
The number of totals.

Member Data Documentation

◆ kCapacity

int BlockStatTable::kCapacity = 1024
staticconstexpr

The rows a table has room for.


The documentation for this class was generated from the following files: