Results 1 to 2 of 2
Thread: STACK SPACE DECISION
Enjoy an ad free experience by logging in. Not a member yet? Register.
- Join Date
- Oct 2004
STACK SPACE DECISION
i m having a query abt how the stack space(more precisely whole segment space for the program) is decided...
V know that For a particualr programm v have 4 different or segments in memory...
Now when v talk abt virtual memeory scenario its also known that 3 GB of memory is allocated by OS for these sections in all...
Starting or 0th byte given to the code segment n then proceeding upwards ..also the stack grows downwards frm the location 3rd GBth location.This whole is decided by OS...,ie.,Os decides the size of the complete memory allocated to these segments in all...
My questions r->
1).According to linux implementation v had 4 GB of Virtual Memory so "y it starts the stack with 3GB memory" ,ie,....Y it alloactes 3GB memory all these segments in all....Y cant 4GB full is allocated...
2)Also if i assume that i had no underlying OS n still i had to prform the task of alloacting space to all these segments then how i decide how much space is allocated to them in all..
3)Also How Stack ptr will b initialised?
4) In normal scenario how this stack ptr gets initialised...
Please do not triple post