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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e1f57751d33f5dc3,start X-Google-Attributes: gid103376,public From: Dr Adrian Wrigley Subject: Problem taking 'Size of large array (gnat) Date: 2000/09/13 Message-ID: <39C00504.65A7A9C@linuxchip.demon.co.uk>#1/1 X-Deja-AN: 669402151 Content-Transfer-Encoding: 7bit X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@home.net X-Trace: news1.crdva1.bc.home.com 968885506 24.115.103.173 (Wed, 13 Sep 2000 15:51:46 PDT) Organization: Excite@Home - The Leader in Broadband MIME-Version: 1.0 NNTP-Posting-Date: Wed, 13 Sep 2000 15:51:46 PDT Newsgroups: comp.lang.ada Date: 2000-09-13T00:00:00+00:00 List-Id: I have encountered a problem running code for handling large records and arrays. Although the ARM says the 'Size attribute is a universal integer, I cannot use the attribute when the expected value would exceed 31 bits. This becomes a problem when the size of the object exceeds 256MB. I was trying to memory map (mmap) a file containing a large record. I am using gnat 3.12p on x86/Linux Questions: 1) Does this problem exist on the other popular Ada implementations on x86? 2) How can I compute the size in bytes of objects > 256MB? Example code is below... -------------- with Text_IO; use Text_IO; procedure ShowSize is type Big is array (0 .. 70_000_000) of Float; type Long is range 0 .. 2**63 - 1; X : Long; begin X := Big'Size; -- Constraint error here! Text_IO.Put_Line ("X got " & Long'Image (X)); end ShowSize; --------------- -- Dr Adrian Wrigley, (currently in Vancouver, BC)