comp.lang.ada
 help / color / mirror / Atom feed
From: "Kevin K" <kevink4@gmail.com>
Subject: Re: Gnat storage size
Date: Sat, 26 Aug 2006 22:42:28 GMT
Date: 2006-08-26T22:42:28+00:00	[thread overview]
Message-ID: <KIRoJuEXw9g9-pn2-YBoMvpK89SIM@localhost> (raw)
In-Reply-To: DNydncf1lOXpE23ZnZ2dnUVZ_tWdnZ2d@comcast.com

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.


-- 




      parent reply	other threads:[~2006-08-26 22:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-26 18:09 Gnat storage size tmoran
2006-08-26 18:46 ` Gautier
2006-08-26 19:26   ` tmoran
2006-08-28  6:26     ` Alex R. Mosteo
2006-08-30  7:53       ` tmoran
2006-09-01 13:24         ` Alex R. Mosteo
2006-08-31  0:15     ` Kevin K
2006-08-31  1:42       ` tmoran
2006-08-31 23:47         ` Kevin K
2006-08-26 22:42 ` Kevin K [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox