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,803df5f3f60558d5 X-Google-Attributes: gid103376,public From: fjh@mundook.cs.mu.OZ.AU (Fergus Henderson) Subject: Re: Uninitialized "out" parameters Date: 1996/07/24 Message-ID: <4t5cm1$gh0@mulga.cs.mu.OZ.AU>#1/1 X-Deja-AN: 170467415 references: <31EEACDA.64880EEB@sage.inel.gov> <4stagp$3vg@mulga.cs.mu.OZ.AU> <4t2gb4$a10@mulga.cs.mu.OZ.AU> organization: Comp Sci, University of Melbourne newsgroups: comp.lang.ada Date: 1996-07-24T00:00:00+00:00 List-Id: bobduff@world.std.com (Robert A Duff) writes: >Fergus Henderson wrote: >>I haven't seen your example. I tried searching for it using dejanews, >>but I did not find any article in this thread posted by you that >>gave an example of a 2 gig array. > >I haven't seen it, either, but I can guess what Robert meant. You >declare an array (1..One_Zillion), and you trust the operating system to >*not* create storage for most of that array. Normally, you just set the >first few elements, and the others are memory-mapped to non-existent >storage. If you were required to say ":= (others => something);", I would hope that a good static checking system would not require initialization at the point of declaration as the only method of initializing arrays; I would hope that it would allow common patterns of initialization such as initializing all the elements one by one in a loop. >the compiler might actually cause writes to all that memory, causing the >OS to actually allocate it, causing Storage_Error, or perhaps just a >huge waste of memory. I suppose that could be a serious problem (even if it only occurred for uncommon patterns of initialization). But you give a solution: >On the other hand, if "something" happens to be, say, "0", then some >operating systems can deal with it by initializing memory pages to zero >as they are needed. The compiler has to know about that fact, and act >accordingly. The DEC Ada-83 compiler on VAX/VMS does this. -- Fergus Henderson | "I have always known that the pursuit WWW: | of excellence is a lethal habit" PGP: finger fjh@128.250.37.3 | -- the last words of T. S. Garp.