Bart Van Assche wrote:
> In the tool I'm writing (drd) I have to know in which direction the stack
> grows. Is it safe to assume that the stack grows downward ? Are there
> intentions to port Valgrind to systems where the stack grows upward ?
HP Precision Architecture (PA-RISC) comes to mind as an example
where the stack grows towards increasing addresses. On any machine
with a "physical" stack, it is simple for C code to discover
the direction of growth by comparing addresses of automatic
scalar local variables in calling<==>called subroutines.
I'd be more concerned by situations that replace "stack frames" with
general activation records allocated from a heap. This can be
particularly attractive for interpreted languages, or for mixed
compiled<->interpreted systems. Such systems often encourage
multi-threaded computation, so races become more likely.
--
|