13constexpr int kMemTagCount = 24;
16constexpr int kMemTagNameSize = 124;
26 char mName[kMemTagNameSize];
31constexpr int kMemStlTagSize = 128;
47void *
operator new[](
size_t nSize);
63void *
operator new(
size_t nSize);
159void operator delete[](
void *pBlock)
noexcept;
172void operator delete(
void *pBlock)
noexcept;
void MemLogSourceReport(const char *pszTitle, FILE *pFile)
Print the per-source table, sorted by name.
void ReportHeapCapacity()
Log how much of the backing allocator is free, then give it all back.
void MemSetStlTag(const char *pszKind, int nElemSize)
Bill the next STL allocation to a container kind and element size.
void MemLogWriteMarker(const char *pszText)
Write a marker line into the memory report.
int MemLogEndCount(char *pszReport, int nReportSize)
Stop charging the accounting table and format its totals.
void MemLogPrint(const char *pszText)
Write text to the memory report while logging is on.
void HeapFree(void *pBlock)
Give a block back to the backing allocator.
void MemFreeTagged(void *pBlock, const char *pszTag, int nLine)
Release a block and record the release against a tag.
void OperatorDeleteOverride(void *pBlock, const char *pszClass)
Release a block that AllocateTaggedMemory() handed out.
void * HeapAlloc(size_t nSize)
Take a block from the backing allocator.
int MemLogFindSource(const char *pszName)
Find or claim the report row for a source name.
void MemLogBeginCount()
Clear the per-tag accounting table and start charging it.
void MemLogCloseAndContinue()
Start a new report file that retains everything written so far.
void MemLogSourceTrackRealloc(const char *pszSource, void *pNew, void *pOld, int nSize)
Move a tracked block to its new address after a resize.
void * MemAllocTagged(size_t nSize, const char *pszTag, int nLine)
Allocate a block and record the request against a tag.
void MemOpenLog(const char *pszPath)
Open the memory report and paint the stack.
void * HeapRealloc(void *pBlock, size_t nSize)
Resize a block through the backing allocator.
void MemLogSourceInit()
Allocate the per-block tracking table and clear the per-source table.
void MemCloseLogAndReport()
Close the memory report and print a summary of the heap.
void DumpHeapMemoryLog(int nIndex)
Write the memory statistics files and probe the largest possible allocation.
char * MemGetCurrentTag()
Address the buffer the STL allocator hook bills its allocations to.
void * AllocateTaggedMemory(size_t nSize, const char *pszClass)
Allocate a block for one object of a named class.
void * MemReallocTagged(void *pBlock, size_t nSize, const char *pszTag, int nLine)
Resize a block and record the move against a tag.