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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no 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!postnews.google.com!o13g2000cwo.googlegroups.com!not-for-mail From: "braver" Newsgroups: comp.lang.ada Subject: Re: Memory limits in Ada where Fortran has none Date: 6 Mar 2005 08:14:21 -0800 Organization: http://groups.google.com Message-ID: <1110125661.857477.251640@o13g2000cwo.googlegroups.com> References: <1110070479.250902.220540@l41g2000cwc.googlegroups.com> <1110089930.914615.182480@l41g2000cwc.googlegroups.com> <1260026.XKFy62IHbW@linux1.krischik.com> NNTP-Posting-Host: 68.38.224.153 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1110125665 2216 127.0.0.1 (6 Mar 2005 16:14:25 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 6 Mar 2005 16:14:25 +0000 (UTC) In-Reply-To: <1260026.XKFy62IHbW@linux1.krischik.com> User-Agent: G2/0.2 Complaints-To: groups-abuse@google.com Injection-Info: o13g2000cwo.googlegroups.com; posting-host=68.38.224.153; posting-account=747fcg0AAAAk37ynL4bMm6Gl7Dz_tnyx Xref: g2news1.google.com comp.lang.ada:8759 Date: 2005-03-06T08:14:21-08:00 List-Id: My working solution is probably what you mean by access function. I could import a Fortran variable from a subroutine by compiling the Fortran module with -fno-automatic, but then I'd still have to declare it in Ada first -- and hit the size limit, or try to turn off index checking, which is bothersome. So instead, I keep the array in Fortran. And as Ada's array access was designed to look the same as a (memoized) function, Fortran being the same, I declare, in Fortran, FUNCTION ND(I) COMMON /NDD/NNDD DIMENSION ND(PARAMETER MMAX=100 000 000) ND = NNDD(I) RETURN END and in Ada, function ND(I: Positive) return Integer; pragma Import (Fortran, ND, External_Name=> "ND", Link_Name=> "nd_" ); pragma Inline(ND); -- import ND, inline it, et voila! I create a package Lord_Fortran to do the importing/inlining, and just with/use it. It is actually surprisingly fast even without turning off range checking. >>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? Cheers, Alexy