The reasons why 64-bit programs require more stack memory
viva64.com
viva64.com
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);
}