Is there a compiler/linker parameter to avoid wasted RAM between global 
variables?  I have a significant number of global vars, made up of chars, ints, 
and a few floats.  When I look at the list output file it shows that the global 
vars are placed into RAM in a seeming random order (maybe the result of a 
hashing function).  The trouble is everytime a char is followed by an int 
another byte of RAM is wasted.  If the vars were put into RAM in the same order 
they showed up in the source code I could group all the char vars together to 
avoid wasted bytes.  The gcc compiler is generating code much smaller than our 
other compiler (10% less flash used), but it is using more RAM and that is the 
most limited resource.  Any ideas on how to avoid the wasted bytes (short of 
changing all the vars to be part of a packed struct)?
Thanks for any help.
 
 



________________________________________________________________________
Interested in getting caught up on today's news?
Click here to checkout USA TODAY Headlines.
http://track.juno.com/s/lc?s=198954&u=http://www.usatoday.com/news/front.htm?csp=24

Reply via email to