Question: please continue this function only // Utilities for malloc blocknode * MemoryManager::findFirstFit (unsigned int chunksize) { // returns a pointer to the first blocknode whose

please continue this function only

// Utilities for malloc

blocknode *

MemoryManager::findFirstFit (unsigned int chunksize)

{

// returns a pointer to the first blocknode whose blocksize is at least chunksize;

// if there is no such blocknode, returns nullptr

here is the memoryManager.h

}please continue this function only // Utilities for malloc blocknode * MemoryManager::findFirstFit

MemoryManager.h class MemoryManager public: MemoryManager(unsigned int memtotal); unsigned char malloc(unsigned int request); void free(unsigned char * ptr2block); void showBlockList); MemoryManager.h private: blocknode *header; blocknode *trailer; unsigned int memsize; II heap size unsigned char *basepu; // pointer to first byte of heap //utilities for malloc method: blocknode*findFirstFit(unsigned int chunksize); void splitBlock(blocknode *p,unsigned int chunksize); //utilities for free method blocknode *findAllocatedBlock (unsigned char *allocated ptr); void mergeForward(blocknode *p); void mergeBackward(blocknode *p)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!