Go to the source code of this file.
|
| int | MemCurrentHeap () |
| | Report the heap new allocations come from.
|
| void | MemFreeBlockStats (int heapNum, int *numBlocks, int *freeBytes, int *biggestBlock) |
| | Report the free runs of a heap.
|
| void | MemGetSystemMemory (int **begin, int **end) |
| | Take the memory the heaps are carved from from the C runtime.
|
| int | MemAddHeap (const char *name, int *start, int sizeWords, bool flag) |
| | Add a heap.
|
| void | MemResizeHeap (int heapNum, int sizeWords) |
| | Move the end of a heap.
|
| void | MemPushHeap (int iHeap) |
| | Make a heap the source of new allocations until MemPopHeap().
|
| void | MemPopHeap () |
| | Return to the heap in use before the last MemPushHeap().
|
| void | MemPreInit () |
| | Set up the main heap over all system memory.
|
| void | MemInit () |
| | Split system memory into the heaps of the heaps_pc configuration and set up the pools.
|
| void * | MemAlloc (int size, const char *name, int align) |
| | Allocate from the current heap.
|
| void | MemFree (void *mem) |
| | Free an allocation of any heap.
|
| int | MemFindHeap (const char *name) |
| | Find a heap by name.
|
| void | MemPrintHeap (int heapNum, PrnStream &stream) |
| | Print every allocation of a heap.
|
|
| const int | MAX_HEAPS = 16 |
| | Number of heaps the memory manager can hold.
|
| Heap | gHeaps [MAX_HEAPS] |
| | The heaps.
|
| int | gNumHeaps |
| | Number of heaps in use.
|
| bool | gMemTracking |
| | Whether allocations are reported to the memory tracker.
|
| bool | gTrackStl |
| | Whether STL allocations are named after their element type for the memory tracker.
|
◆ MemCurrentHeap()
Report the heap new allocations come from.
- Returns
- The heap on top of the heap stack.
- Ghidra address:
- 0x100100f0
◆ MemFreeBlockStats()
| void MemFreeBlockStats |
( |
int | heapNum, |
|
|
int * | numBlocks, |
|
|
int * | freeBytes, |
|
|
int * | biggestBlock ) |
Report the free runs of a heap.
- Parameters
-
| heapNum | The heap. |
| numBlocks | Receives the number of free runs. |
| freeBytes | Receives the bytes in all free runs. |
| biggestBlock | Receives the bytes in the largest free run. |
- Ghidra address:
- 0x10010100
◆ MemGetSystemMemory()
| void MemGetSystemMemory |
( |
int ** | begin, |
|
|
int ** | end ) |
Take the memory the heaps are carved from from the C runtime.
- Parameters
-
| begin | Receives the first word. |
| end | Receives the word past the end. |
- Ghidra address:
- 0x10010150
◆ MemAddHeap()
| int MemAddHeap |
( |
const char * | name, |
|
|
int * | start, |
|
|
int | sizeWords, |
|
|
bool | flag ) |
Add a heap.
- Parameters
-
| name | The heap's name. |
| start | The first word of the heap. |
| sizeWords | The size of the heap in words. |
| flag | The third value of the heap's configuration entry. |
- Returns
- The new heap's index.
- Ghidra address:
- 0x10010170
◆ MemResizeHeap()
| void MemResizeHeap |
( |
int | heapNum, |
|
|
int | sizeWords ) |
Move the end of a heap.
- Parameters
-
| heapNum | The heap. |
| sizeWords | The new size in words. |
- Ghidra address:
- 0x100101b0
◆ MemPushHeap()
| void MemPushHeap |
( |
int | iHeap | ) |
|
Make a heap the source of new allocations until MemPopHeap().
- Parameters
-
- Ghidra address:
- 0x10010770
◆ MemPopHeap()
Return to the heap in use before the last MemPushHeap().
- Ghidra address:
- 0x100107e0
◆ MemPreInit()
Set up the main heap over all system memory.
MemAlloc() calls the routine when no heap exists yet.
- Ghidra address:
- 0x100107f0
◆ MemInit()
Split system memory into the heaps of the heaps_pc configuration and set up the pools.
Only the first call has an effect.
- Ghidra address:
- 0x10010870
◆ MemAlloc()
| void * MemAlloc |
( |
int | size, |
|
|
const char * | name, |
|
|
int | align ) |
Allocate from the current heap.
- Parameters
-
| size | The size in bytes. |
| name | The allocation's name for the memory tracker. |
| align | The alignment in bytes, or zero for the default of 16. |
- Returns
- The allocation.
- Ghidra address:
- 0x10010a90
◆ MemFree()
| void MemFree |
( |
void * | mem | ) |
|
Free an allocation of any heap.
A pointer outside every heap fails.
- Parameters
-
| mem | The allocation, or null. |
- Ghidra address:
- 0x10010b80
◆ MemFindHeap()
| int MemFindHeap |
( |
const char * | name | ) |
|
Find a heap by name.
- Parameters
-
- Returns
- The heap's index, or -1.
- Ghidra address:
- 0x10010c40
◆ MemPrintHeap()
| void MemPrintHeap |
( |
int | heapNum, |
|
|
PrnStream & | stream ) |
Print every allocation of a heap.
- Parameters
-
| heapNum | The heap. |
| stream | The destination. |
- Ghidra address:
- 0x10010ca0
◆ MAX_HEAPS
Number of heaps the memory manager can hold.
◆ gHeaps
The heaps.
- Ghidra address:
- 0x100c1130
◆ gNumHeaps
Number of heaps in use.
- Ghidra address:
- 0x100c13b8
◆ gMemTracking
Whether allocations are reported to the memory tracker.
- Ghidra address:
- 0x100c13c5
◆ gTrackStl
Whether STL allocations are named after their element type for the memory tracker.
- Ghidra address:
- 0x100c13c6