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-02-27 19:19:36 PST Newsgroups: comp.lang.ada Path: supernews.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!news-hog.berkeley.edu!ucberkeley!enews.sgi.com!nntp.msen.com!uunet!ash.uu.net!world!bobduff From: Robert A Duff Subject: Re: Problems with large records (GNAT) [continued] Sender: bobduff@world.std.com (Robert A Duff) Message-ID: Date: Wed, 28 Feb 2001 03:13:02 GMT References: <3A9CD67C.9B15C417@linuxchip.demon.co.uk> Organization: The World Public Access UNIX, Brookline, MA X-Newsreader: Gnus v5.3/Emacs 19.34 Xref: supernews.google.com comp.lang.ada:5328 Date: 2001-02-28T03:13:02+00:00 List-Id: Dr Adrian Wrigley writes: > 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)). No. But then I haven't read comp.lang.ada in months. ;-) > I never managed to solve that problem, and made do with keeping > all my records under 256MB (!). I'm curious: Why do you need such enormous records? And if your data structures are almost as big as your 32-bit address space, why don't you get a machine with a 64-bit address space? > This time, I have come across another manifestation of the problem, > which appears rather strange. The locations for different > elements in a record are the same. In the example code below, > the elements First and Last are stored in the same place. > (you can verify this using 'Access on the two elements). They're not aliased in the code below, so 'Access isn't allowed. Perhaps you meant 'Address? Anyway, I can't explain that problem, but... > X := Malloc (Interfaces.C.Size_T (Size * Float'Size + 2*Float'Size)); -- Hmmmm Float'Size is in bits, whereas malloc expects a size in bytes (or in units of sizeof(char), or whatever). You need to divide by System.Storage_Unit, and you need to write your code carefully to avoid overflow, since you're dealing with numbers close to Integer'Last. Why are you using malloc anyway? Why not "X := new Item_t;"? - Bob P.S. If you think you've found a bug in GNAT, report it, and maybe they'll fix it.