74 void initHeap(
size_t initialHeapSize);
linkedList_t mcbAllocList
typedef of linked list node (see s_ll_node).
const char * mcbTypeToString(e_mcb_type_t type)
The s_cmcb struct the struct type for cmcb's -> defines the properties.
void printMCBFunc(void *cmcb)
printMCBFunc prints the type, block size, block pointer of the blocks in a given list.
int mcbCompareFunc(void *mcb, void *mcbToCompare)
mcbCompareFunc compares the start addresses of two mcbs.
typedef of linked list (see s_ll).
mcbSize_t sizeOfHeapAllocated()
e_mcb_result_t lastMCBError
void printAlloc()
printAlloc prints the allocated memory blocks. Traverses through the allocated mcb list...
const char * mcbResultToString(e_mcb_result_t result)
void initHeap(size_t initialHeapSize)
initHeap initializes the system heap by calling kmalloc with a valid byte size. Creates a CMCB at the...
int heapIsEmpty()
heapIsEmpty returns if the heap is empty.
mcbAddressPtr_t blockStartAddress
void insertMCBIntoList(cmcb_t *blockToInsert)
insertMCBIntoList inserts the mcb into the list specified.
The s_lmcb struct defines the properties of lmcb's.
e_mcb_result_t
The e_mcb_result_t enum defines the return status of functions working with MCBs. ...
e_mcb_type_t
The e_mcb_type_t enum defines the state of the MCBs.
struct s_cmcb __attribute__((packed))
int mcbSearchCompFunc(void *mcb, void *blockStartAddress)
mcbSearchCompFunc searches for the mcb that you want to compare with.
mcbSize_t sizeOfHeapFree()
mcbAddressPtr_t blockStopAddress
void heapTest()
heapTest test function to create sample mcbs.
void printFree()
printFree prints the free memory blocks. Traverses through the free mcb list.
void * allocateMemFromHeap(size_t requestedSize)
allocateMemFromHeap takes the requested size and finds the first block that fits. Implements first fi...
int freeHeapMem(void *blockAddress)
freeHeapMem takes the block address and frees the memory from the CMCB start to the LMCB end location...
void reclaimFreeMem()
reclaimFreeMem groups free blocks together if they are adjacent.