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-Thread: 103376,49eb370bfd3baa90 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.clear.net.nz!news.clear.net.nz.POSTED!not-for-mail NNTP-Posting-Date: Sun, 06 Mar 2005 17:10:32 -0600 From: Craig Carey Newsgroups: comp.lang.ada Subject: Re: Memory limits in Ada where Fortran has none Date: Mon, 07 Mar 2005 12:09:33 +1300 Message-ID: References: <1110070479.250902.220540@l41g2000cwc.googlegroups.com> <1110089930.914615.182480@l41g2000cwc.googlegroups.com> <1260026.XKFy62IHbW@linux1.krischik.com> <1110125661.857477.251640@o13g2000cwo.googlegroups.com> X-Newsreader: Forte Agent 2.0/32.652 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Original-NNTP-Posting-Host: ip-210-185-4-60.internet.co.nz X-Original-Trace: 7 Mar 2005 11:47:06 +1300, ip-210-185-4-60.internet.co.nz Organization: "ICONZ Ltd." X-Original-NNTP-Posting-Host: news.nz.asiaonline.net X-Original-Trace: 7 Mar 2005 12:10:29 +1300, news.nz.asiaonline.net X-Trace: sv3-PgTUJ6WRzZXzLs9hTUlxV9xm+FPE4R2QmIpyHPWkp8ouNGDwSv1FJ+D3tAyrcqMa6QBWYWL4FHovpsH!iONN9O4wBoZaKAb826cxLbhAiDtTpbzICEB785OpdCFf6WpFtmseHvSCgkqQoNBdoWXo6r/0geXk!pDmjlZE= X-Complaints-To: Complaints to abuse@clear.net.nz X-DMCA-Complaints-To: Complaints to abuse@clear.net.nz X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news1.google.com comp.lang.ada:8779 Date: 2005-03-07T12:09:33+13:00 List-Id: I guess that the FORTRAN was leaving too little memory for the Ada 95 program. On 6 Mar 2005 08:14:21 -0800, "braver" wrote: >My working solution is probably what you mean by access function. ... >>>From now on, I allocate data arrays longer than 256*256*1024 elements >in Fortran. As people guessed correctly, I use GNAT -- what else can I >do on Linux, given I can't find a downloadable/trial copy of Rational >Apex, even though IBM took over it? As for patches -- anyone heard of >a 32-bit 'Size / 'Storage_Size patch to GNAT? I guess that allocating memory on the Ada 95 side is not needed. Maybe a thin pointer to a not allocated huge array could be used. E.g.: type AA is array (Positive range <>) of ...; type Huge is array AA (Positive) Type Huge_Ptr is access Huge; F : Heap_Array_Ptr := new .... -- A fat array double pointer X : Huge_Ptr := unchecked conversion from (F (F'First)); -- Upper bound range checking on indexing X is absent When importing a FORTRAN array into Ada 95, there is a choice of: * an allocated array, or * a pointer to a not allocated array. If the size is not known then it can be an array that is too large to allocate. A pointer to the 1st element of any array including a FORTRAN array is converted to a super large array. That zaps the upper bound index checking. So adding pointers can be avoided using indexing. (If not, then GNAT source code of the gcc.gnu.org package "Interfaces.C.Pointers" could be adapted.) Also, there is the GNAT linker options allowing the stack size and heap size to be altered. They are described in the GNAT User's Guide: gnatmake ... -largs --stack=0x30000" The GNAT Users guide says: $ gnatlink hello -Xlinker --stack=0x10000,0x1000 "This set the stack reserve size to 0x10000 bytes and the stack commit size to 0x1000 bytes." $ gnatlink hello -Xlinker --heap=0x10000,0x1000 "This set the heap reserve size to 0x10000 bytes and the heap commit size to 0x1000 bytes." On 6 Mar 2005 14:13:13 -0800, Gerald wrote: ... >You should dynamically allocate the big array: ... Hmm -- Craig Carey Avondale, Auckland, New Zealand -- Fairness checklist: http://www.ombudsman.on.ca/pdf/fairness_stds.pdf -- Ada 95 mailing lists: http://www.ijs.co.nz/ada_95.htm