naive question about tracebacks

Andrew Koenig ark at research.att.com
Wed Feb 19 23:24:30 EST 2003


logistix> Which way does a stack grow in memory? It starts at lower
logistix> addresses and climbs to higher ones.  The traceback is just
logistix> printing the stack frames in sequential order, instead of
logistix> printing the frames as it pops them off.

The hidden point is that every other system I've seen that provides
what it calls a traceback does so by printing the most recent call
context first.

As for your question:  Which way a stack grows in memory depends on
the implementation.  I've used machines on which stacks grow from low
addresses toward high addresses, and other machines on which stacks
grow in the opposite directions.  I've even used machines on which
stacks are not contiguous, so the question is meaningless.

-- 
Andrew Koenig, ark at research.att.com, http://www.research.att.com/info/ark




More information about the Python-list mailing list