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 ELPAGE BYTES. Calls mmap with similar
arguments to those used in elinit however requests the address
of the pages to be at heapend so that the heap grows
contiguously. If this fails, prints the message
l
ERROR: Unable to mmap additional pages
and returns Note that mmap returns the constant HAPFAILED 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 elappendpagestoheapint npages
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
