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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,be7fa91648ac3f12 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!zen.net.uk!dedekind.zen.co.uk!nntp-peering.plus.net!ptn-nntp-feeder02.plus.net!ptn-nntp-spool01.plus.net!ptn-nntp-reader03.plus.net!not-for-mail User-Agent: Microsoft-Entourage/10.1.6.040913.0 Date: Wed, 13 Apr 2005 23:01:23 +0100 Subject: Re: Large arrays (again), problem case for GNAT From: "(see below)" Newsgroups: comp.lang.ada Message-ID: References: Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit Organization: Customer of PlusNet plc (http://www.plus.net) NNTP-Posting-Host: 9321ffad.ptn-nntp-reader03.plus.net X-Trace: DXC=kf0gaR3h8UfkB78;O6`b9oigd3Y`7Rb;n@`8gV4CC7IgYTI\\_:3`?d]?TVh8652jmOcSkbW?GUbbnCS9Ui\S0gf X-Complaints-To: abuse@plus.net Xref: g2news1.google.com comp.lang.ada:10440 Date: 2005-04-13T23:01:23+01:00 List-Id: On 13/4/05 8:54 pm, in article ltGdnU4oIZ3j5cDfRVn-qw@megapath.net, "Randy Brukardt" wrote: > Text_IO.Put_Line ("Writing to all elements in loop"); > for I in Big_T'Range loop > Big (I) := 0.0; > end loop; > > Text_IO.Put_Line ("Writing to 'Last element"); > Big (Big_T'Last) := 0.0; -- Fails!!!!! For better confirmation of success I changed this to: > Text_IO.Put_Line ("Writing to all elements in loop"); > for I in Big_T'Range loop > Big (I) := Float(i); > end loop; > > Text_IO.Put_Line ("Reading 'Last element"); > if Big (Big_T'Last) /= Float(Big_T'Last) then > Text_IO.Put_Line ("...FAILED"); > else > Text_IO.Put_Line ("...OK"); > end if; It compiled and ran perfectly on my 640Mb Macintosh iBook, GNAT 3.3 20040913 (GNAT for Mac OS X build 1650): > First element attribute 1 > Last element attribute 210000000 > Address of first element is 33587200 > Address of last element is 873587196 > (Last element should be at higher address than first) > Address of last element is 873587196 > Writing to all elements in loop > Reading 'Last element > ...OK I see that Adrian is using Linux. Is Linux not notorious for problems of this kind? I seem to remember that it has some kind of optimistic allocator that can grant a memory allocation request, only for it to fail when you try to use the memory you appear to have been granted. -- Bill Findlay chez blueyonder.co.uk