OpenBarnyard
 
Loading...
Searching...
No Matches
TMemory::MemNode Class Reference

Represents a node in the memory allocation system. More...

#include <TMemory.h>

Public Member Functions

void * GetDataRegionStart () const
 Gets the start address of the data region for this node.
 
void * GetDataRegionEnd () const
 Gets the end address of the data region for this node.
 

Public Attributes

MemNodepOwner
 Owner node if this is a sub-allocation.
 
TSIZE uiSize
 Size of the memory region.
 
union { 
 
   MemNode *   pNextHole 
 Next free hole in the list. More...
 
   MemBlock *   pMemBlock 
 Memory block this node belongs to. More...
 
};  
 
MemNodepPrevHole
 Previous free hole in the list.
 

Detailed Description

Represents a node in the memory allocation system.

Each MemNode tracks a piece of memory that can be either allocated or free. The node contains metadata about the memory region and links to other nodes.

Definition at line 69 of file TMemory.h.

Member Function Documentation

◆ GetDataRegionEnd()

void * TMemory::MemNode::GetDataRegionEnd ( ) const
inline

Gets the end address of the data region for this node.

Returns
Pointer to the end of the data region

Definition at line 82 of file TMemory.h.

82{ return (void*)( ( (TUINTPTR)&pPrevHole + TAlignNumDown( uiSize ) ) ); }
TFORCEINLINE constexpr T TAlignNumDown(T a_iValue, TSIZE a_uiAlignment=4)
Definition Helpers.h:59
uintptr_t TUINTPTR
Definition Typedefs.h:18
TSIZE uiSize
Size of the memory region.
Definition TMemory.h:86
MemNode * pPrevHole
Previous free hole in the list.
Definition TMemory.h:93

◆ GetDataRegionStart()

void * TMemory::MemNode::GetDataRegionStart ( ) const
inline

Gets the start address of the data region for this node.

Returns
Pointer to the start of the data region

Definition at line 76 of file TMemory.h.

76{ return (void*)( &pPrevHole ); }

Member Data Documentation

◆ [union]

union { ... } TMemory::MemNode

◆ pMemBlock

MemBlock* TMemory::MemNode::pMemBlock

Memory block this node belongs to.

Definition at line 90 of file TMemory.h.

◆ pNextHole

MemNode* TMemory::MemNode::pNextHole

Next free hole in the list.

Definition at line 89 of file TMemory.h.

◆ pOwner

MemNode* TMemory::MemNode::pOwner

Owner node if this is a sub-allocation.

Definition at line 85 of file TMemory.h.

◆ pPrevHole

MemNode* TMemory::MemNode::pPrevHole

Previous free hole in the list.

Definition at line 93 of file TMemory.h.

◆ uiSize

TSIZE TMemory::MemNode::uiSize

Size of the memory region.

Definition at line 86 of file TMemory.h.


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