where does system stack grow in cpp?

D

David White

GB said:
E. Robert Tisdale said:
Evidently, my program stack grows "upward"

According to your output, your stack grows downward (i.e., decreasing
addresses), not upward. The (virtual) addresses you printed are
decreasing with increased level of nesting (1 being the deepest
nesting).
from the "bottom" of [virtual] memory (0xffffffff)
toward the "top" of [virtual] memory (0x00000000).

In what sense would 0xffffffff be the "bottom" of a presumably 32-bit
virtual memory space?

Well, if you print out a block of memory from address zero it is likely that
the addresses will increase from the top of the page to the bottom, which
makes address zero the "top". However, I thought the convention was to call
zero the bottom and 0xffff.... the top.

DW
 
J

Jack Klein

Actually, I think that all architectures have stack growing down today.

You're wrong to think that. There are some architectures (ARM, for
one), where you can choose the stack direction at compile time. Of
course, all source and libraries combined into a single executable
must be built with the same choice.

There are also some architectures (again including ARM), where you can
select big or little endian orientation.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,077
Latest member
SangMoor21

Latest Threads

Top