Discussion:
A3 Stack Increase Question
(too old to reply)
Sungyoul Kim
2011-07-22 08:04:23 UTC
Permalink
Hello,

As far as I understand, we need to allocate some # (13? i guess) of
pages for the stack. We can pre-allocate it since there is nothing in
the stack when it is initialized, and it is not loading data.


What if a program wants to increase the stack ? (If the stack size
increases and the program access virtual addresses lower than
0x80000000-13*PAGE_SIZE)

How do we handle it?

Do we need to keep allocating a page when the stack counter decreases?



Thank you,

Sungyoul
cs350
2011-07-22 18:15:21 UTC
Permalink
You don't have to preallocate the stack and you shouldn't increase it
beyond the standard size.

-Alex
Post by Sungyoul Kim
Hello,
As far as I understand, we need to allocate some # (13? i guess) of pages for
the stack. We can pre-allocate it since there is nothing in the stack when it
is initialized, and it is not loading data.
What if a program wants to increase the stack ? (If the stack size increases
and the program access virtual addresses lower than 0x80000000-13*PAGE_SIZE)
How do we handle it?
Do we need to keep allocating a page when the stack counter decreases?
Thank you,
Sungyoul
Loading...