title: Understanding and implementing malloc
body: <p>How is malloc implemented internally ? How to implement malloc with below necessary conditions</p>
  
  <p>•   Malloc allocates at least the number of bytes requested</p>
  
  <p>•   The pointer returned by malloc points to an allocated space ( i.e. a space where the program can read or write successfully;)</p>
  
  <p>•   No other call to malloc will allocate this space or any portion of it, unless the pointer has been freed before.</p>
  
  <p>•   malloc should be tractable: malloc must terminate in as soon as possible (it should not be NP-hard !;)</p>
  
  <p>•   Malloc should also provide resizing and freeing.</p>
  
  <p>The function obey to the following signature:
  Void * malloc(size_t size);</p>