wavelength 1.0.0
Loading...
Searching...
No Matches
MemTrack.h File Reference
#include "utl/AllocInfo.h"
#include "utl/Data.h"
#include "utl/MemStats.h"
#include "utl/PrnStream.h"
Include dependency graph for MemTrack.h:

Go to the source code of this file.

Classes

class  MemTrack
 Allocation tracker for one heap. More...

Functions

bool MemTrackEnabled ()
 Report whether allocation tracking is built in.
void MemTrackInit (int heap, int *begin, int *end)
 Start tracking a heap, or follow its new size.
void MemTrackDataInit ()
 Add the debug heap the tracker's own containers use and register the heap_report command.
void MemTrackAlloc (int size, const char *type, int actual, void *ptr)
 Record a heap allocation in the current heap's tracker.
void MemTrackFree (int heap, void *ptr)
 Forget a heap allocation.
void MemTrackPoolAlloc (int size, const char *type, void *ptr)
 Record a pool node in the main heap's tracker.
void MemTrackPoolFree (void *ptr)
 Forget a pool node.
void MemTrackReport (int heap, int minSize, PrnStream &stream)
 Print a heap's report and its change since the previous one, after the date and time.
void MemTrackReportAllocsByName (int heap, PrnStream &stream)
 Print how many allocations of a heap share each name and size.
void DataHeapReport (DataArray *args, void *data)
 Run the heap_report script command.

Function Documentation

◆ MemTrackEnabled()

bool MemTrackEnabled ( )

Report whether allocation tracking is built in.

This build returns false.

Returns
Whether tracking is available.
Ghidra address:
0x10018670

◆ MemTrackInit()

void MemTrackInit ( int heap,
int * begin,
int * end )

Start tracking a heap, or follow its new size.

Parameters
heapThe heap's index.
beginThe heap's first word.
endThe word past the heap.
Ghidra address:
0x10018680

◆ MemTrackDataInit()

void MemTrackDataInit ( )

Add the debug heap the tracker's own containers use and register the heap_report command.

Ghidra address:
0x10018930

◆ MemTrackAlloc()

void MemTrackAlloc ( int size,
const char * type,
int actual,
void * ptr )

Record a heap allocation in the current heap's tracker.

Parameters
sizeThe bytes requested.
typeThe allocation's name.
actualThe bytes allocated.
ptrThe allocation.
Ghidra address:
0x10018990

◆ MemTrackFree()

void MemTrackFree ( int heap,
void * ptr )

Forget a heap allocation.

Parameters
heapThe heap.
ptrThe allocation.
Ghidra address:
0x100189c0

◆ MemTrackPoolAlloc()

void MemTrackPoolAlloc ( int size,
const char * type,
void * ptr )

Record a pool node in the main heap's tracker.

Parameters
sizeThe node size in bytes.
typeThe node's name.
ptrThe node.
Ghidra address:
0x100189e0

◆ MemTrackPoolFree()

void MemTrackPoolFree ( void * ptr)

Forget a pool node.

Parameters
ptrThe node.
Ghidra address:
0x10018a30

◆ MemTrackReport()

void MemTrackReport ( int heap,
int minSize,
PrnStream & stream )

Print a heap's report and its change since the previous one, after the date and time.

Parameters
heapThe heap.
minSizeThe smallest total, in bytes allocated, that prints.
streamThe destination.
Ghidra address:
0x100184c0

◆ MemTrackReportAllocsByName()

void MemTrackReportAllocsByName ( int heap,
PrnStream & stream )

Print how many allocations of a heap share each name and size.

Parameters
heapThe heap.
streamThe destination.
Ghidra address:
0x10018530

◆ DataHeapReport()

void DataHeapReport ( DataArray * args,
void * data )

Run the heap_report script command.

The command is (heap_report <report|dump|freelist> <heap>...). The output goes to the log file mem_<command>.txt.

Parameters
argsThe command.
dataThe data the command was registered with, unused.
Ghidra address:
0x10018790