From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Problems with large records (GNAT) [continued]
Date: Fri, 2 Mar 2001 14:32:42 -0600
Date: 2001-03-02T14:32:42-06:00 [thread overview]
Message-ID: <mtTn6.3730$7e6.1474096@homer.alpha.net> (raw)
In-Reply-To: 3A9CD67C.9B15C417@linuxchip.demon.co.uk
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;
next prev parent reply other threads:[~2001-03-02 20:32 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-02-28 10:44 Problems with large records (GNAT) [continued] Dr Adrian Wrigley
2001-02-28 3:13 ` Robert A Duff
2001-02-28 12:09 ` Dr Adrian Wrigley
2001-02-28 9:51 ` Florian Weimer
2001-02-28 18:35 ` Laurent Guerby
2001-03-01 8:17 ` Dr Adrian Wrigley
2001-03-01 1:58 ` Robert A Duff
2001-03-01 22:18 ` Dr Adrian Wrigley
2001-03-01 17:02 ` Robert A Duff
2001-03-01 7:00 ` tmoran
2001-03-01 21:52 ` Dr Adrian Wrigley
2001-03-01 19:32 ` tmoran
2001-03-01 19:38 ` Laurent Guerby
2001-03-02 20:32 ` Randy Brukardt [this message]
2001-03-07 2:15 ` Dr Adrian Wrigley
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox