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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ead02e7101c0c023 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-02 12:36:04 PST Path: supernews.google.com!sn-xit-03!supernews.com!hermes.visi.com!news-out.visi.com!nycmny1-snh1.gtei.net.MISMATCH!cpk-news-hub1.bbnplanet.com!cambridge1-snf1.gtei.net!news.gtei.net!homer.alpha.net!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada References: <3A9CD67C.9B15C417@linuxchip.demon.co.uk> Subject: Re: Problems with large records (GNAT) [continued] X-Newsreader: Microsoft Outlook Express 4.72.3612.1700 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3719.2500 Message-ID: Date: Fri, 2 Mar 2001 14:32:42 -0600 NNTP-Posting-Host: 156.46.62.124 X-Complaints-To: abuse@alpha.net X-Trace: homer.alpha.net 983565266 156.46.62.124 (Fri, 02 Mar 2001 14:34:26 CST) NNTP-Posting-Date: Fri, 02 Mar 2001 14:34:26 CST Xref: supernews.google.com comp.lang.ada:5385 Date: 2001-03-02T14:32:42-06:00 List-Id: Dr Adrian Wrigley wrote in message <3A9CD67C.9B15C417@linuxchip.demon.co.uk>... >Hi all! > >You might remember a while back I had a problem with 'Size failing >on large types, using GNAT (3.12p Intel Linux (Red Hat 6.2)). >I never managed to solve that problem, and made do with keeping >all my records under 256MB (!). I tried this for grins on Janus/Ada. I get ** Unhandled CONSTRAINT_ERROR Value of literal out of the base type which makes sense, because Janus/Ada only has 32-bit integers. Moreover, it won't work right, because Big_T has a dynamic size. How compilers allocate that will vary, but it doesn't necessarily have to be continugous. (Indeed, Item_T'Size = 32*8 on Janus/Ada; the array is stored separately.) So, I tried using "new" instead, with the index type of Big_T being static. Here's the result: First is 3.14159E+00 last is 2.71828E+00 Sounds to me like you need a different compiler. Our phone number is 1-800-722-3248 or visit www.rrsoftware.com. :-) (I would not expect a problem with a program like this in Janus/Ada, since it does all of its memory address calculations in units of bytes. But then again, I won't expect it in any other compiler either.) Randy Brukardt. -- Here's the program I ran: with Text_IO; procedure Dum2 is Size : constant := 256*1024*1024 - 1; type Index_Type is range 1 .. Size; type Big_T is array (Index_Type) of Float; type Item_T is record First : Float; Item : Big_T; Last : Float; end record; type Item_A is access all Item_T; X : Item_A; begin X := new Item_T; X.First := 3.14159; X.Last := 2.71828; Text_IO.Put_Line ("First is " & Float'Image (X.First) & " last is " & Float'Image (X.Last)); end Dum2;