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,73c865853bdc4937 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!newscon04.news.prodigy.net!prodigy.net!newsdst01.news.prodigy.net!prodigy.com!postmaster.news.prodigy.com!newssvr29.news.prodigy.net.POSTED!660be329!not-for-mail From: "Kevin K" Message-ID: Newsgroups: comp.lang.ada Subject: Re: Gnat storage size References: User-Agent: ProNews/2 V1.57.cp107 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit NNTP-Posting-Host: 68.91.128.209 X-Complaints-To: abuse@prodigy.net X-Trace: newssvr29.news.prodigy.net 1156632148 ST000 68.91.128.209 (Sat, 26 Aug 2006 18:42:28 EDT) NNTP-Posting-Date: Sat, 26 Aug 2006 18:42:28 EDT Organization: SBC http://yahoo.sbc.com X-UserInfo1: OP[MQ[OG\JWUST@[N[O@_WH@YR_B@EXLLBWLOOAFJYWZUYICD^RAQBKZQTZTX\_I[^G_KGFNON[ZOE_AZNVO^\XGGNTCIRPIJH[@RQKBXLRZ@CD^HKANYVW@RLGEZEJN@\_WZJBNZYYKVIOR]T]MNMG_Z[YVWSCH_Q[GPC_A@CARQVXDSDA^M]@DRVUM@RBM Date: Sat, 26 Aug 2006 22:42:28 GMT Xref: g2news2.google.com comp.lang.ada:6402 Date: 2006-08-26T22:42:28+00:00 List-Id: On Sat, 26 Aug 2006 18:09:56 UTC, tmoran@acm.org wrote: > What command line parameter do I need with Gnat 3.15p to increase the > main program's stack size? I'm getting > raised STORAGE_ERROR : big.adb:4 object too large > when the command line parameter is >= 4026 with the program: > with ada.command_line; > procedure big is > procedure try(k : in integer) is > x : array(1 .. k*1042) of integer; > begin > x(1) := 0; > end try; > begin > try(integer'value(ada.command_line.argument(1))); > end big; First, what is OS are you interested in? The normal way, going from memory, is: ... end big; pragma main(stack_size=>20000000); --for a 20 meg stack. However there are caveats on some common platforms like the Mac and Windows. With Windows you also have to do some linker arguments, which should be explained in the GNAT documentation. With OS X, my experimentation earlier this year shows a fairly limited stack size, which make code using large stacks problematic. For your example above, using access types would appear to be the best solution. Then, it is less dependent on stack sizes, no matter the OS. --