Fill in the appropriate code, assuming that blocks are of th…

Fill in the appropriate code, assuming that blocks are of the format: Header (8 bytes)  User Payload Space Footer (8 bytes) Additionally, assume size and allocation information are packed together using the function from Note 1, and that this packed data is stored in the header and footer of a block.  The stored size includes the size of the header and footer and user payload space. // Returns a pointer to the header of the block// payload_pointer – pointer to user payload space of a blockuint64_t* get_header_pointer(char* payload_pointer){  return ;} // Returns a pointer to the footer of the block// payload_pointer – pointer to user payload space of a blockchar* get_footer_pointer(char* payload_pointer){   return payload_pointer + ;} // Returns a pointer to the user payload space of the previous block in the heap// curr_payload_pointer – pointer to user payload space of current blockchar* prev_payload_pointer(char* curr_payload_pointer){  return curr_payload_pointer – ;} // Returns a pointer to the user payload space of the next block in the heap// curr_payload_pointer – pointer to user payload space of current blockchar* next_payload_pointer(char* curr_payload_pointer){  return curr_payload_pointer + ;}

Note 2:  The following 6 questions show gdb memory dumps of…

Note 2:  The following 6 questions show gdb memory dumps of the heap from a malloc implementation where 16-byte alignment is maintained.  The implementation includes the following features: We always use 8 byte headers and footers in all blocks, and they are equal to each other. The headers/footers contain the size of the block including the size of the header and footer and user payload space The headers/footers contain an alloc bit in the lowest bit to indicate if the block is allocated (1) or free (0) We use a prologue header/footer with the size of the prologue (i.e., 16 bytes) We use an epilogue header with a size of 0 The prologue and epilogue are marked as allocated There are 8 bytes of padding before the prologue to maintain proper alignment The heap is initialized without any space between the prologue and epilogue (i.e., empty heap) When adding space at the end of the heap in malloc, we add the minimum necessary space to fit the user request while accounting for alignment issues malloc will split blocks into the minimum space for the user to leave the most free space for later use free will immediately coalesce neighboring blocks We use an implicit free list implementation (i.e., no explicit free list or segregated free list) Each question builds upon the previous question, following this sequence: mm_init() alloc1 = malloc(16) alloc2 = malloc(32) free(alloc1) free(alloc2) alloc3 = malloc(25)