Free list of nodes of one size, grown a chunk of nodes at a time from the hunks of the pool.
More...
#include <freestore.h>
|
| struct | Node |
| | A free node, which starts with the link to the next one. More...
|
|
| | FreeStore (int nNodeWords) |
| | Construct an empty store.
|
| void * | Alloc () |
| | Hand out a node, growing the store when none is free.
|
| void | Free (void *pNode) |
| | Return a node.
|
| void | Grow () |
| | Add a chunk of mNodesPerChunk free nodes.
|
| void * | AllocChunk (int nBytes) |
| | Take a chunk of nodes from the hunks of the pool.
|
| void | GetStats (int *pnNodeBytes, int *pnAllocs, int *pnMaxAllocs, int *pnCapacity, int *pnWasted) |
| | Report the use of the store.
|
|
| static void * | operator new (size_t nSize) |
| | Allocate a store from the pool heaps.
|
| static void | Configure (DataArray *pConfig) |
| | Read the sizes of the pool's hunks from the pool block of the mem configuration.
|
| static void * | AllocHunk (int nBytes) |
| | Carve bytes from the current hunk of the pool, allocating a new hunk when they do not fit.
|
Free list of nodes of one size, grown a chunk of nodes at a time from the hunks of the pool.
The class is not polymorphic. The name is inferred. FixedSizeAlloc keeps one for each node size.
◆ FreeStore()
| FreeStore::FreeStore |
( |
int | nNodeWords | ) |
|
|
explicit |
Construct an empty store.
- Parameters
-
| nNodeWords | The size of each node in words. |
- Ghidra address:
- NTSC-U/C: 0x0029dc78
- Ghidra address:
- PAL: 0x002a7940
◆ operator new()
| void * FreeStore::operator new |
( |
size_t | nSize | ) |
|
|
inlinestatic |
Allocate a store from the pool heaps.
- Parameters
-
| nSize | The size of the store. |
- Returns
- The block.
◆ Alloc()
| void * FreeStore::Alloc |
( |
| ) |
|
Hand out a node, growing the store when none is free.
- Returns
- The node.
- Ghidra address:
- NTSC-U/C: 0x0029dca0
- Ghidra address:
- PAL: 0x002a7968
◆ Free()
| void FreeStore::Free |
( |
void * | pNode | ) |
|
Return a node.
- Parameters
-
- Ghidra address:
- NTSC-U/C: 0x0029dd00
- Ghidra address:
- PAL: 0x002a79c8
◆ Grow()
Add a chunk of mNodesPerChunk free nodes.
- Ghidra address:
- NTSC-U/C: 0x0029dd20
- Ghidra address:
- PAL: 0x002a79e8
◆ AllocChunk()
| void * FreeStore::AllocChunk |
( |
int | nBytes | ) |
|
Take a chunk of nodes from the hunks of the pool.
- Parameters
-
| nBytes | The size of the chunk. |
- Returns
- The chunk.
- Ghidra address:
- NTSC-U/C: 0x0029ddb0
- Ghidra address:
- PAL: 0x002a7a78
◆ GetStats()
| void FreeStore::GetStats |
( |
int * | pnNodeBytes, |
|
|
int * | pnAllocs, |
|
|
int * | pnMaxAllocs, |
|
|
int * | pnCapacity, |
|
|
int * | pnWasted ) |
Report the use of the store.
- Parameters
-
| pnNodeBytes | Receives the size of each node in bytes. |
| pnAllocs | Receives the nodes handed out. |
| pnMaxAllocs | Receives the most nodes handed out at one time. |
| pnCapacity | Receives the nodes of every chunk. |
| pnWasted | Receives the bytes of the free nodes. |
- Ghidra address:
- NTSC-U/C: 0x0029ddd0
- Ghidra address:
- PAL: 0x002a7a98
◆ Configure()
| void FreeStore::Configure |
( |
DataArray * | pConfig | ) |
|
|
static |
Read the sizes of the pool's hunks from the pool block of the mem configuration.
The first hunk takes big_hunk bytes and every later one small_hunk bytes.
- Parameters
-
- Ghidra address:
- NTSC-U/C: 0x0029db70
- Ghidra address:
- PAL: 0x002a7838
◆ AllocHunk()
| void * FreeStore::AllocHunk |
( |
int | nBytes | ) |
|
|
static |
Carve bytes from the current hunk of the pool, allocating a new hunk when they do not fit.
- Parameters
-
- Returns
- The bytes.
- Ghidra address:
- NTSC-U/C: 0x0029dbc8
- Ghidra address:
- PAL: 0x002a7890
◆ sHunkBytes
| int FreeStore::sHunkBytes |
|
static |
The bytes AllocHunk() has handed out.
- Ghidra address:
- NTSC-U/C: 0x003b2420
- Ghidra address:
- PAL: 0x004312e0
The documentation for this class was generated from the following file: