wavelength 1.0.0
Loading...
Searching...
No Matches
ChunkAllocator Class Reference

Small-object allocator with one FixedSizeAlloc for each 16-byte size class up to 2048 bytes. More...

#include <ChunkAllocator.h>

Public Member Functions

 ChunkAllocator ()
 Create an allocator with no size class in use.
void * Alloc (int size, int unused)
 Allocate from the size class of a size, creating the class's allocator on first use.
void Free (void *mem, int size)
 Free an allocation of a size class.
void Print (PrnStream &stream)
 Print the use of every size class.

Detailed Description

Small-object allocator with one FixedSizeAlloc for each 16-byte size class up to 2048 bytes.

The object is 0x200 bytes. The name comes from the assertions that guard its one instance, gChunkAlloc.

Constructor & Destructor Documentation

◆ ChunkAllocator()

ChunkAllocator::ChunkAllocator ( )

Create an allocator with no size class in use.

Ghidra address:
0x100119e0

Member Function Documentation

◆ Alloc()

void * ChunkAllocator::Alloc ( int size,
int unused )

Allocate from the size class of a size, creating the class's allocator on first use.

Parameters
sizeThe size in bytes.
unusedA value the routine does not read.
Returns
The allocation.
Ghidra address:
0x10011a00

◆ Free()

void ChunkAllocator::Free ( void * mem,
int size )

Free an allocation of a size class.

Parameters
memThe allocation.
sizeThe size it was allocated with.
Ghidra address:
0x10011ae0

◆ Print()

void ChunkAllocator::Print ( PrnStream & stream)

Print the use of every size class.

Parameters
streamThe destination.
Ghidra address:
0x10011b60

The documentation for this class was generated from the following file: