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,FREEMAIL_FROM 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!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Sat, 05 Mar 2005 19:09:03 -0600 Date: Sat, 05 Mar 2005 20:09:24 -0500 From: Jeff C User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Memory limits in Ada where Fortran has none References: <1110070479.250902.220540@l41g2000cwc.googlegroups.com> In-Reply-To: <1110070479.250902.220540@l41g2000cwc.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: X-Trace: sv3-auIl0AfojPzn0AVbO9GgHoOq16qxcCxwmZmpI6kYZNy7h1WxAiBq2s9s2jMDjNXocXpS6tFQHxeSR1y!f/lpJfiuVECSKCdG3ro80VP3kLUig+iK39bSleewUf1mFB/VOmdm8Mi2wQ6G9A== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.net 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:8705 Date: 2005-03-05T20:09:24-05:00 List-Id: braver wrote: > I'm interoperating with a Fortran algorithm using a very large array of > integers: > > PARAMETER (NMAX=100000000) ! a hundred million > DIMENSION ND(NMAX) > C ... > > In Ada, I declared it as > > type Intarray is array (Positive range <>) of Integer; > > ND: Intarray(1..NMAX); -- (1) > > -- then I get a STORAGE_ERROR right about NMAX is 2_000_000. > If you are doing that in a procedure (including the main procedure) then ND is being allocated on the Stack not the heap. If ND were inside of a package then you should get the same results that you got with your pointer approach. As for the pointer approach also being "too small" it is not that your heap is limited. You can declare (via pointers or package level variables) lots of objects of your max size. You just can't have a single variable with a 'size that exceeds the 32 bit limit. To be precise here this is not "and Ada thing". This is one particular vendor (guessing GCC) decision about an implementation defined limit...And I agree it is an unfortunate choice that was probably reasonable a few years ago and has now become too small.