| Robert 2008-03-14, 6:57 pm |
| On Fri, 14 Mar 2008 14:29:05 GMT, "William M. Klein" <wmklein@nospam.netcom.com> wrote:
>Concerning ther statement,
>
> "They are allocated no later than immediately before initialization"
>
>Let's look again at the entire paragraph which states,
>
>"Data items and file connectors defined in the working-storage, communication,
>or file section of a source element that is not an initial program are static
>items. Also, screen item attributes in a source element that is not an initial
>program are treated as static items. These items are set to their initial state
>each time the runtime element or object containing them is set to its initial
>state, as described in 14.5.2.1.2.1, Initial state, and in 14.5.2.2, Initial
>state of object data. They are allocated no later than immediately before
>initialization and persist to the first of the following:
>- the end of the run unit,
>- the execution of a CANCEL statement of a program that directly or indirectly
>contains the items,
>- the end of the object's life cycle in the case of object data."
>
>It seems to me that Robert is assuming that "before initialization" is PROGRAM
>initialization, but in context it is clear that the "they" is the individual
>data items. It is also clear that THEIR "persistance" in this context ends with
>a CANCEL and that the next time the same program is CALLed, this same
>"initialization" (and allocation before) can occur.
The question for THIS particular thread is whether "The standard says working-storage is
allocated statically." versus whether working-storage items can be reallocated dynamically
while the program is running.
The standard calls them "static items" without defining the phrase. Dictionaries define
static and its Latin root statis as motionless, fixed. It seems clear to me that a static
data item is one whose address does not change during the item's life. By contrast, a
dynamic item is mobile in memory.
>Again, all of this refers to what the Standard says (which is minimal) about what
>type of allocation is done for what it calls "static" items and does not imply
>how many (if any) existing compiler/run-times do storage allocation as a part of
>setting to the 2nd through N-th time of "initial state".
The 02 standard says under CANCEL:
"NOTE It is neither prohibited nor required that the storage of the specified program be
freed by the execution of a CANCEL statement."
I wish standards writers didn't embelish substantive statements with "note", giving the
impression the statements are parenthetical asides. ISO should employ copy editors to
clean up awkward techie writing style.
|