Re: Newbie doubts about stack !

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

 



On Sun, Sep 15, 2002 at 01:01:38PM +0100, James Stevenson wrote:
> > In the function part of the assembly
> > file , I noticed that the depending on
> > the "SIZE" of the array , it allocates
> > memory on stack as shown in the below
> > table .
> >
> >  Array Size       Actual stack allocation
> >
> >     0  - 4     =    4
> >     5  - 16    =   24
> >     17 - 32    =   40
> >     33 - 48    =   56
> >     49 - 64    =   72
> >
> > Can anybody please explain me ,
> > what is the reason behind this ?
> >
> > Why is it that only the required
> > amount of stack is not allocated ?
> 
> compilers tend to optimize by keeping the stack aligned
> on certin boundries and also some machines always require
> that say the stack point must always be on a quad word
> boundry. Do you actually use the variable at all ?
> a really simple compliler optimizeation is to remove anything that
> is not referenced even when you dont use and optimizeation flags.

One question remains. What are the 8 extra bytes for?

-------------------------------------------------------------------------------
						 Jan 'Bulb' Hudec <bulb@ucw.cz>
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux