Re: allocation alignment for global and local variables.
- From: Kenneth Brody <kenbrody@xxxxxxxxxxx>
- Date: Fri, 30 Sep 2005 11:55:57 -0400
Eric Sosman wrote:
[... memory order of global variables ...]
> (I once had a lot of trouble porting a large program from
> one machine to the other. On the original machine, file-scope
> variables within a module were allocated to ascending memory
> addresses in the order they were declared -- so foo1 would be
> followed by bar1 in the example above -- and the variables from
> different modules were allocated in the order in which the
> modules were linked. On the target machine I was porting to,
> though, all globals from all modules were pooled together and
> sorted alphabetically by their names. It turned out that the
> program's author relied on the allocate-as-declared order ...)
Too bad you can't say "he got what he deserved", as it was you who ended
up getting it.
--
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody | www.hvcomputer.com | |
| kenbrody/at\spamcop.net | www.fptech.com | #include <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------------+
Don't e-mail me at: <mailto:ThisIsASpamTrap@xxxxxxxxx>
.
- References:
- allocation alignment for global and local variables.
- From: gamja
- Re: allocation alignment for global and local variables.
- From: Eric Sosman
- allocation alignment for global and local variables.
- Prev by Date: Re: Global variables
- Next by Date: Re: size of pointer in C?
- Previous by thread: Re: allocation alignment for global and local variables.
- Next by thread: Re: Looking for PowerC Library Source Disk
- Index(es):