Original Post
🔒 Locked
Stack
Advertisement
Modern CPU?
On x86, the stack is just a piece of memory that happens to be referenced by ss:esp.
An .exe can specify the amount of stack space it needs; the OS can dynamically grow the stack (=> not all of the mem needs to be committed immediately; accessing the last ("guard") page results in a page fault (''cause the OS marked it ''not present''), and more memory is allocated).
Doesn''t really make sense to speak of a ''hardware runtime stack''. Did you mean cache?
500x1
On x86, the stack is just a piece of memory that happens to be referenced by ss:esp.
An .exe can specify the amount of stack space it needs; the OS can dynamically grow the stack (=> not all of the mem needs to be committed immediately; accessing the last ("guard") page results in a page fault (''cause the OS marked it ''not present''), and more memory is allocated).
Doesn''t really make sense to speak of a ''hardware runtime stack''. Did you mean cache?
500x1
What Jan wrote is correct. This is meant to flesh out his comment a little more and answer the question about the stack size without reference to the confusion over hardware.
According to Jeff Richter''s book "Advanced Windows" (aka "Programming Applications"), the default stack size for a windows program compiled with MSVC is 1 Mb of address space plus two pages of committed memory. The size of the stack can be altered at compile time through the use of the /STACK switch.
/STACK:reserve[,commit]
According to Jeff Richter''s book "Advanced Windows" (aka "Programming Applications"), the default stack size for a windows program compiled with MSVC is 1 Mb of address space plus two pages of committed memory. The size of the stack can be altered at compile time through the use of the /STACK switch.
/STACK:reserve[,commit]
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement