Yes this is a school project. Yes I do have problems understanding on how to implement it, I would like to bang out any misconceptions or misunderstandings that I have. This is supposed to use a first fit algorithm. Here is the thing...

I pass into that method the size of the memory block that I would like to have. I will most likely need to use sbrk and then brk in order to get a grip on the piece of virtual memory that will be filled in at a later time. I also will need to increase the stack that will hold the desired piece of memory.

My question is. How can I possibly search through the gaps in memory and find the desired piece? How would you implement that (sorry, I don't even know where to begin )?