comp.lang.ada
 help / color / mirror / Atom feed
From: Dr Adrian Wrigley <amtw@linuxchip.demon.co.uk>
Subject: Re: Problems with large records (GNAT) [continued]
Date: Thu, 01 Mar 2001 14:18:12 -0800
Date: 2001-03-01T14:18:12-08:00	[thread overview]
Message-ID: <3A9ECAA4.6E279BC9@linuxchip.demon.co.uk> (raw)
In-Reply-To: wccbsrmntbh.fsf@world.std.com

Robert A Duff wrote:
> 
> Dr Adrian Wrigley <amtw@linuxchip.demon.co.uk> writes:
> 
> > If I increase the number of stocks to 5000, things break and significant
> > changes are necessary because the 256M limit is exceeded.
> 
> I didn't see the program that shows this 256M limit.  Please post it
> (again?), along with its output.  Make sure your program is compiled
> with all run-time checks turned on, which is not the default in GNAT
> (unfortunately).

The procedure "Dum" in the original post fails when Item_T reaches
256M - bizarrely with a STORAGE_ERROR for 256M-512M and 768-1024M,
and silently for 512M-768M and 1024-1280M. (assuming the size
in bytes is correctly calculated - as you pointed out, and
assuming you can successfully malloc that much space).
You saw this demonstration of the limit.  But I'll give you
another example... 

The following procedure "Big" simply generates a constraint error,
because the array exceeds the 256M limit.

$ gnatmake -gnato big
gnatgcc -c -gnato big.adb
big.adb:10:64: warning: Constraint_Error will be raised at run-time
big.adb:11:64: warning: Constraint_Error will be raised at run-time


-----------------------
with System;
with Text_IO;

procedure Big is

   type Big_T is array (0 .. 64*1024*1024) of Float;

begin

   Text_IO.Put_Line ("Size of Big_T is " &
                     Integer'Image (Big_T'Size / System.Storage_Unit));
   Text_IO.Put_Line ("Size of Big_T is " &
                     Integer'Image (Big_T'Max_size_in_storage_elements));

end Big;
-----------------------
Adrian



  reply	other threads:[~2001-03-01 22:18 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 [this message]
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
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