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,b550c25b7ecf7e27 X-Google-Attributes: gid103376,public From: stt@houdini.camb.inmet.com (Tucker Taft) Subject: Re: Adjust bug? re-post Date: 1997/07/21 Message-ID: #1/1 X-Deja-AN: 257911139 Sender: news@inmet.camb.inmet.com (USENET news) X-Nntp-Posting-Host: houdini.camb.inmet.com References: <33D26588.7247@bix.com> Organization: Intermetrics, Inc. Newsgroups: comp.lang.ada Date: 1997-07-21T00:00:00+00:00 List-Id: Tom Moran (tmoran@bix.com) wrote: : A second problem, unrelated to access pointers, is that Initialize and : Adjust become superfluous. Since you can't assume that either has been : called for a particular object, every routine that uses an object must : first detect whether it was Initialized/Adjusted and if not, do the : appropriate things. I think you are jumping to conclusions. An object is initialized one of three ways, by default initialization (calls Initialize), by copy (calls Adjust), or by component-by-component initialization (i.e. via an aggregate -- only possible where full definition is visible). The optimization in this case was that the object was *moved*, not that it was created without one of the above 3 actions. If you see movement as inherently creating a new object, then you need to use limited types, or make one of the subcomponents aliased. Normally, however, it shouldn't matter where an object is, so long as it only exists in one place at a given time. It might live in a register for a while, and then in memory for awhile. It might be passed across a network, and then be passed back later. : ... But that means the sole effect of coding an : Initialize/Adjust is a (probably slight) advance in the time at which : the object will Initialized/Adjusted. I think you have missed the nature of the optimization. Compilers are free to move controlled objects around, in general, just like a garbage collector is allowed to "compactify" in some languages. You have to work a little harder if you want to prevent this movement (by making one of the subcomponents aliased). The purpose of "Adjust" is to accommodate the case when there are now two copies of the same value, instead of just one. By contrast, when an object moves, there is still only one value, not two. -- -Tucker Taft stt@inmet.com http://www.inmet.com/~stt/ Intermetrics, Inc. Burlington, MA USA