If there is a function like:
int func1() {
int status = func2();
// Do something with status.
return status;
}
In the course of this function a variable status of type int is allocated memory and during the course of the function the variable is used and then returned from func1.
My question is, when is the memory garbage collected for this primitive, or does it remains in memory for ever?