When the subroutine returns the stack pointer is adjusted


The UNIX kernel will dynamically grow a process's stack in virtual memory as needed, but it will never try to shrink it. Consider the case in which a program calls a C subroutine that allocates a local array on the stack that consumes 10K. The kernel will expand the stack segment to accommodate it. When the subroutine returns, the stack pointer is adjusted and this space could be released by the kernel, but it is not released. Explain why it would be possible to shrink the stack at this point and why the UNIX kernel does not shrink it.

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: When the subroutine returns the stack pointer is adjusted
Reference No:- TGS01595936

Expected delivery within 24 Hours