This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: global variables not defined contiguously in memory
- From: Andrew Haley <aph at redhat dot com>
- To: mikwilmot <michael dot i dot wilmot dot ctr at navy dot mil>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Thu, 05 Mar 2009 15:11:15 +0000
- Subject: Re: global variables not defined contiguously in memory
- References: <22353471.post@talk.nabble.com>
mikwilmot wrote:
> We are having a problem with defining global variables and having them
> allocated contiguously in memory. There are two portions of two different
> files. In FILE 1 the variables are defined all over memory, in FILE 2 the
> variables are defined contiguously in memory. Our application has certain
> reads that requires variables be defined one after another in memory.
Oh dear. That's really bad.
If you want contiguous allocation, you'll have to put all
your global variables in a struct.
Andrew.