KernOS
KM::MemoryAllocator Class Reference

Manages kernel heap memory. More...

#include <memoryallocator.h>

Public Member Functions

void Initialize (const uint32_t StartAdd, const uint32_t EndAdd)
 Points to range of reserved physical memory for heap allocator use. More...
 

Public Attributes

uint32_t m_StartAdd = 0
 range of reserved address for kernel heap memory More...
 
uint32_t m_EndAdd = 0
 range of reserved address for kernel heap memory More...
 
Header m_Base {nullptr, 0}
 list start More...
 

Detailed Description

Manages kernel heap memory.

1) Keeps track of linked list of free memory,
2) allocates requested memory,
3) and coalesces freed memory if adjacent with other free block

Todo:
figure out a way to enforce singleton without heap alloc, or function static variable

Definition at line 59 of file memoryallocator.h.

Member Function Documentation

◆ Initialize()

void KM::MemoryAllocator::Initialize ( const uint32_t  StartAdd,
const uint32_t  EndAdd 
)

Points to range of reserved physical memory for heap allocator use.

Parameters
StartAddstart of reserved physical memory
EndAddend of reserved physical memory

Definition at line 15 of file memoryallocator.cpp.

Member Data Documentation

◆ m_Base

Header KM::MemoryAllocator::m_Base {nullptr, 0}

list start

Definition at line 66 of file memoryallocator.h.

◆ m_EndAdd

uint32_t KM::MemoryAllocator::m_EndAdd = 0

range of reserved address for kernel heap memory

Definition at line 64 of file memoryallocator.h.

◆ m_StartAdd

uint32_t KM::MemoryAllocator::m_StartAdd = 0

range of reserved address for kernel heap memory

Definition at line 63 of file memoryallocator.h.


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