Simple question: Is there a way to determine the stack size of a function?
int stackframe_size(int run) {
int i ;
if(!run) {
return ((int)(&i) - stackframe_size(++run));
}
return (int)(&i);
}
int main() {
int x, y;
double d;
char c;
int a = 4;
int b = 5;
int we = 6;
int e = 123123;
int hmm = 34453;
int lol = 45;
int asd = 23;
x = 1;
y = g(x);
d = f(x, y, x-y);
c = 'a';
printf("%d", stackframe_size(0));
}
I am running the function I obtained from another thread to find the call stack size and it always seems to return 48...is there another way to find out or is this the only way?