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

Go to the source code of this file.

Functions

void PoolAllocInit (DataArray *config)
 Read the chunk sizes of the pools from the pool configuration.
void * PoolChunkAlloc (int bytes)
 Carve memory for pool nodes from the current chunk, taking a new chunk when it is too small.
void * PoolAlloc (int classSize, int reqSize, const char *name, int unused)
 Allocate an object from the pools.
void PoolFree (int size, void *mem)
 Return an object to the pools.
void PoolReport (PrnStream &stream)
 Print the use of the pools.
void * _PoolAlloc (int size, const char *name)
 Allocate from the pools, or from the current heap when the size exceeds 128 bytes.
void _PoolFree (int size, void *mem)
 Free memory from _PoolAlloc().

Variables

int gPoolChunkBytes
 Bytes taken through PoolChunkAlloc().

Function Documentation

◆ PoolAllocInit()

void PoolAllocInit ( DataArray * config)

Read the chunk sizes of the pools from the pool configuration.

The first chunk is big_hunk bytes and every later one small_hunk bytes.

Parameters
configThe pool configuration.
Ghidra address:
0x100117e0

◆ PoolChunkAlloc()

void * PoolChunkAlloc ( int bytes)

Carve memory for pool nodes from the current chunk, taking a new chunk when it is too small.

The rest of a chunk too small for the request is abandoned.

Parameters
bytesThe size in bytes, rounded down to whole words.
Returns
The memory.
Ghidra address:
0x10011810

◆ PoolAlloc()

void * PoolAlloc ( int classSize,
int reqSize,
const char * name,
int unused )

Allocate an object from the pools.

Parameters
classSizeThe size of the object's class in bytes.
reqSizeThe size requested. It must equal the class size.
nameThe object's name for the memory tracker.
unusedA value passed through and not read.
Returns
The object.
Ghidra address:
0x10011c10

◆ PoolFree()

void PoolFree ( int size,
void * mem )

Return an object to the pools.

Parameters
sizeThe size it was allocated with.
memThe object.
Ghidra address:
0x10011ca0

◆ PoolReport()

void PoolReport ( PrnStream & stream)

Print the use of the pools.

Parameters
streamThe destination.
Ghidra address:
0x10011d00

◆ _PoolAlloc()

void * _PoolAlloc ( int size,
const char * name )

Allocate from the pools, or from the current heap when the size exceeds 128 bytes.

Parameters
sizeThe size in bytes.
nameThe allocation's name for the memory tracker.
Returns
The allocation, or null for a size of zero.
Ghidra address:
0x10011d40

◆ _PoolFree()

void _PoolFree ( int size,
void * mem )

Free memory from _PoolAlloc().

Parameters
sizeThe size it was allocated with.
memThe allocation, or null.
Ghidra address:
0x10011d80

Variable Documentation

◆ gPoolChunkBytes

int gPoolChunkBytes
extern

Bytes taken through PoolChunkAlloc().

Ghidra address:
0x100c18cc