Today, I appeared for an interview and the interviewer asked me this,
- Tell me the steps how will you design your own
f
malloc
and free
only have a meaning if your app is to work on top of an OS. If you would like to write your own memory management functions you would have to know how to request the memory from that specific OS or you could reserve the heap memory right away using existing malloc
and then use your own functions to distribute/redistribute the allocated memory through out your app