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-01 06:24:07 PST Path: supernews.google.com!sn-xit-03!supernews.com!newsswitch.lcs.mit.edu!feed2.onemain.com!feed1.onemain.com!newsfeeds.belnet.be!news.belnet.be!btnet-peer1!btnet-peer0!btnet!news5-gui.server.ntli.net!ntli.net!news11-gui.server.ntli.net.POSTED!not-for-mail Message-ID: <3A9ECAA4.6E279BC9@linuxchip.demon.co.uk> From: Dr Adrian Wrigley X-Mailer: Mozilla 4.7 [en] (X11; U; Linux 2.2.14-5.0smp i686) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Problems with large records (GNAT) [continued] References: <3A9CD67C.9B15C417@linuxchip.demon.co.uk> <86lmqq8xks.fsf@acm.org> <3A9E05B0.46B406ED@linuxchip.demon.co.uk> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Thu, 01 Mar 2001 14:18:12 -0800 NNTP-Posting-Host: 62.253.132.124 X-Complaints-To: abuse@ntlworld.com X-Trace: news11-gui.server.ntli.net 983456238 62.253.132.124 (Thu, 01 Mar 2001 14:17:18 GMT) NNTP-Posting-Date: Thu, 01 Mar 2001 14:17:18 GMT Organization: ntl Cablemodem News Service Xref: supernews.google.com comp.lang.ada:5351 Date: 2001-03-01T14:18:12-08:00 List-Id: Robert A Duff wrote: > > Dr Adrian Wrigley 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