From: "Theodore E. Dennison" <dennison@escmail.orl.mmc.com>
Subject: Re: Constants: how are they allocated?
Date: 1996/05/02
Date: 1996-05-02T00:00:00+00:00 [thread overview]
Message-ID: <3188B2E5.4B761E89@escmail.orl.mmc.com> (raw)
In-Reply-To: Pine.HPP.3.91.960501205541.13373A-100000@louie.csun.edu
Justin Gombos wrote:
>
> When a constant is assigned to a variable, is the constant stored on the
> stack, or in the heap?
That depends on your compiler, and on how and where the constant was
declared.
Your compiler's docs (if they are any good) should shed light on this.
I know in VADS's case it LOOKS LIKE constants that aren't "static" are
meerly variables that the compiler won't let you update. They have
'ADDRESSes, and are stored in the same place a variable would be:
On the heap if they are global to a package or the main routine.
On the stack if they are in the body of a task or subprogram.
Constants that are static are meerly textually replaced by their value
at run-time.
If I remember correctly, DEC Ada handles constants quite differently.
--
T.E.D.
| Work - mailto:dennison@escmail.orl.mmc.com |
| Home - mailto:dennison@iag.net |
| URL - http://www.iag.net/~dennison |
next prev parent reply other threads:[~1996-05-02 0:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-05-01 0:00 Constants: how are they allocated? Justin Gombos
1996-05-02 0:00 ` Theodore E. Dennison [this message]
1996-05-02 0:00 ` Chad Bremmon
1996-05-06 0:00 ` justin gombos
1996-05-06 0:00 ` Robert A Duff
1996-05-06 0:00 ` Theodore E. Dennison
1996-05-06 0:00 ` Theodore E. Dennison
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox