Question: / / HEAP EXPANSION FUNCTIONS / / REQUIRED / / Attempts to append pages of memory to the heap with mmap ( ) . npages

// HEAP EXPANSION FUNCTIONS
// REQUIRED
// Attempts to append pages of memory to the heap with mmap (). npages
// is how many pages are to be appended with total bytes to be
// appended as npages * EL_PAGE BYTES. Calls mmap() with similar
// arguments to those used in el__init() however requests the address
// of the pages to be at heap_end so that the heap grows
// contiguously. If this fails, prints the message
/l
// ERROR: Unable to mmap() additional 3 pages
1?
??? and returns 1. Note that mmap() returns the constant HAP_FAILED on
??? errors and the returned address will not match the requested
// virtual address on fallures.
???
// Otherwise, adjusts heap size and end for the expanded heap. Creates
// a new block for the freshly allocated pages that is added to the
// ava; able list. Also attempts to merge this block with the block
// below it. Returns on success.
int el_append_pages_to_heap(int npages){
/ / HEAP EXPANSION FUNCTIONS / / REQUIRED / /

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Finance Questions!