Code Comments
Programming Forum and web based access to our favorite programming groups.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, communicati on, >or file section of a source element that is not an initial program are stat ic >items. Also, screen item attributes in a source element that is not an init ial >program are treated as static items. These items are set to their initial s tate >each time the runtime element or object containing them is set to its initi al >state, as described in 14.5.2.1.2.1, Initial state, and in 14.5.2.2, Initia l >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 indirec tly >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 PROG RAM >initialization, but in context it is clear that the "they" is the individua l >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 workin g-storage is allocated statically." versus whether working-storage items can be reallocat ed dynamically while the program is running. The standard calls them "static items" without defining the phrase. Dictiona ries 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 co ntrast, a dynamic item is mobile in memory. >Again, all of this refers to what the Standard says (which is minimal) abou t what >type of allocation is done for what it calls "static" items and does not im ply >how many (if any) existing compiler/run-times do storage allocation as a pa rt 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 specifie d 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 e ditors to clean up awkward techie writing style.
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.