Re: Gnat storage size
On Sat, 26 Aug 2006 18:09:56 UTC, tmoran@xxxxxxx 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.
--
.
Relevant Pages
- Re: Dial-up clients drop connections-XP Home w/SP2, suspect bad regist
... Windows help - www.rickrogers.org ... > How to reset Internet Protocol in Windows XP ... > stack to restore it to its state that existed when the operating system ... a reset command is available in the IP context ... (microsoft.public.windowsxp.general) - Re: singe thread per connection
... process is about 2000, with the practical maximum somewhat lower, and performance suffering significantly before that. ... If you use a different stack size than the default, or don't actually allocate one OS thread per Java thread, then the actual limit would be different. ... But in Windows, both in the regular Win32 API and under .NET, there are i/o mechanisms that can be used that allow a single thread to service an arbitrarily large number of i/o tasks. ... This allows a program to create just enough threads to keep all the CPU cores busy, and the Windows scheduler knows to treat those threads specially so that if the only other runnable thread is one that would do the same thing that the currently running thread would do, the currently running thread is allowed to just keep running, rather than being preempted for no good reason. ... (comp.lang.java.programmer) - Re: Iczelions tutorials revisited.
... By "local" variables on the stack I assume something like this? ... access parameters and locals that way. ... The Windows API uses "stdcall" in which "callee cleans up stack" - the Windows functions end with "ret N". ... Being an old dos-head, I'm used to using cx as a "counter", and it annoys me that calling libc or the Windows API is allowed to trash it, but that's life... ... (alt.lang.asm) - Re: Is MASM32 an evil Microsoft plot?
... Now your next blunder is to call the default windows message handler ... > you could use most any assembler and the whole advocacy for MASM disappears. ... C3;; retn ... Is there supposed to be some profundity at addressing the stack ... (alt.lang.asm) - Re: Need some help understanding array definitions
... their Windows product, ... Windows and DLL calls, and I'm sure MPE's equivalents address the same ... space available on the return stack at any given time. ... We don't have ALLOCATE or local buffers, ... (comp.lang.forth) |
|