From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,25e7db2f1ea1e260 X-Google-Attributes: gid103376,public From: "Theodore E. Dennison" Subject: Re: Constants: how are they allocated? Date: 1996/05/02 Message-ID: <3188B2E5.4B761E89@escmail.orl.mmc.com>#1/1 X-Deja-AN: 152606679 references: content-type: text/plain; charset=us-ascii organization: Lockheed Martin Information Systems mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 2.0 (X11; I; SunOS 4.1.3_U1 sun4m) Date: 1996-05-02T00:00:00+00:00 List-Id: 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 |