previous | start | next

Function Specification: mm_malloc

      void * mm_malloc(size_t size)

      param: size - The requested size (payload only) of a block
      Description: Calculate the adjusted size, asize, to
      include the header and footer and round up if necessary to
      satisfy the alignment requirement (e.g. total size must be a
      multiple of 8).

      Then 
          (1) call find_fit to get a free block of size >= asize
              that has been removed from the linked list (or tree) of
              free blocks 
          (2) if no block found call extend_heap to get a free block
          (3) if extend_heap can't extend the heap return NULL
          (4) otherwise call place with the free block and the
              requested size, asize to possibly split the block and to
              mark the selected block as allocated.
          (5) return the allocated block that is returned by place

      Return: the allocated block or return NULL if no block could be
          found and the heap could not be extended.
   


previous | start | next