3 ms·
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
by mortenlarsen 14y ago
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);
}