Guys,
I'm interested in how the compiler implements function calls, can anyone
correct my understanding/point me towards some good articles.
When a function is called, is the stack pointer incremented by the size of
the variables declared in the called function, and then the function will
know where these are in memory relative to the current stack pointer
position. ALso how are variables returned, is that by a set position in the
stack??
ie,
void func1()
{
int a;
}
void func2()
{
int a,b;
char c;
}
will these both execute at exactly the same speed??
Thanks
Mike
I'm interested in how the compiler implements function calls, can anyone
correct my understanding/point me towards some good articles.
When a function is called, is the stack pointer incremented by the size of
the variables declared in the called function, and then the function will
know where these are in memory relative to the current stack pointer
position. ALso how are variables returned, is that by a set position in the
stack??
ie,
void func1()
{
int a;
}
void func2()
{
int a,b;
char c;
}
will these both execute at exactly the same speed??
Thanks
Mike
Comment