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

Free block of a Heap, a node of the heap's free list in address order. More...

#include <heap.h>

Collaboration diagram for FreeBlock:

Public Member Functions

bool Merge (FreeBlock *pNext)
 Absorb the free block that starts where this one ends.
int * EndAddr ()
 Report the word after the run.
bool Coalesce (FreeBlock *next)
 Absorb the next free run when it starts where this run ends.

Public Attributes

int mSizeWords
FreeBlock * mNext

Detailed Description

Free block of a Heap, a node of the heap's free list in address order.

Header of a free run of words in a heap.

The class is not polymorphic. The name is inferred.

The header occupies the first two words of the run. A heap links its free runs in a singly linked list sorted by address. The name is inferred from the heap's assertions.

Member Function Documentation

◆ Merge()

bool FreeBlock::Merge ( FreeBlock * pNext)

Absorb the free block that starts where this one ends.

Parameters
pNextThe following free block.
Returns
Whether pNext starts where this block ends, and was absorbed.
Ghidra address:
NTSC-U/C: 0x0029a430
Ghidra address:
PAL: 0x002a4050

◆ EndAddr()

int * FreeBlock::EndAddr ( )
inline

Report the word after the run.

Returns
The first word past the run.

◆ Coalesce()

bool FreeBlock::Coalesce ( FreeBlock * next)

Absorb the next free run when it starts where this run ends.

Parameters
nextThe run after this one in the free list.
Returns
Whether the runs were merged.
Ghidra address:
0x10010560

Member Data Documentation

◆ mSizeWords

int FreeBlock::mSizeWords

The size of the block in words, this node included.

Length of the run in words, including this header.

◆ mNext

FreeBlock * FreeBlock::mNext

The next free block, at a higher address, or null.

The next free run at a higher address, or null.


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