question about allocating local variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



My question is... 
I wrote the program like this.
 
void func()
{
  char a[8];
}

And then compile to asm code I've got this line of
code.

.....
subl $8 %esp
.....

That makes sense, It moves stack pointer down 8 bytes
for local variable.
But the problem is, when I change size of array to 9
or 7 the asm code turn to this.

....
subl $24 %esp
....

It doesn't make any sense to me. Why it allocates 24
bytes for 9 or 7 bytes variable.

Does anybody has any explaination?

Thank in advance.
Prawit C.


		
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux