

The reasons why 64-bit programs require more stack memory - AndreyKarpov
http://www.viva64.com/en/b/0069/

======
mortenlarsen
On Linux there seems to be little difference between 32 and 64 bit. It seems
that the calling convention is different, and that no shadow space is
allocated.

I am not sure if this is how you are supposed to use the function. I only
tried the first example, but I am not sure if I used it correctly.

    
    
      g++ stackuse_simple.cpp -o stackuse64
      g++ -m32 stackuse_simple.cpp -o stackuse32
      ---------------------------------------------------------
      //stackuse_simple.cpp
      #include <iostream>
      using namespace std;
      
      void StackUse(size_t *depth)
      {
        volatile size_t *ptr = 0;
        if (depth != NULL)
          ptr = depth;
        cout << *ptr << endl;
        (*ptr)++;
        StackUse(depth);
        (*ptr)--;
      }
      
      int main() {
          size_t d = 0;
          StackUse(&d);
      }

------
Tekker
I would have preferred he simply turned off optimization, for clearer results,
rather than obfuscate the code (and who knows what other optimizations were
still in place).

