Consider this function:
void main(){ int c, d, e, f; c = function(1, 2, 3, 4); d =1; e = 2; f = 3; }
However, this will allocate 0x20 space.
But if you add another local parameter or function parameter, it will immediately allocate 0x30 space.
Now consider when there is nothing in the main function, but only one statement:
int c = 1;
Then in this case 0x10 space will be allocated.
Do you see the template here? First, the system allocates space for the local variable. Then it will allocate space for function parameters. Allocated space is aligned to 0x10.
That is why you see 0x20. 0x10 for local variables, and another 0x10 for function parameters.
source share