Re: Largest size array in Gnat 2005 for the PC?



On Tue, 30 Oct, Pascal Obry wrote:
ME a écrit :
I am using the stack. how do I change this at link time using GPL?

There is no option for that use "new" to allocate the array instead of
declaring it on the stack.

While I agree with the given suggestion to allocate large objects on
the heap instead of the stack, there is a way to increase the stack
size on Windows. We use something like the following in our projects
where we need a larger stack on Windows:

package Linker is
case OS is
when "UNIX" =>
null;
when "Windows_NT" =>
for Default_Switches ("ada") use ("--stack=0x2000000,0x10000");
end case;
end Linker;

--
Stefan Bellon
.



Relevant Pages

  • Re: "Heap" (was Re: static, global variable memory allocation)
    ... common to refer to the area used to allocate automatic objects ... Can a perverse but conforming implementation use the "heap" for ... used a linked list of save areas instead of a stack. ... CPU-specific region of memory that grows linearly in one direction, ...
    (comp.lang.c)
  • Re: style question,itoa
    ... able to allocate buffers in some convenient location the callee ... dynamically allocate a block of memory and computing this size to use ... call might require allocating a page for the stack. ... " Checking every single malloc in a bigger application for possible ...
    (comp.unix.programmer)
  • Re: run-time vs compile-time
    ... > offset related to some location (like stack base) somewhere. ... > offset from heap to pi. ... When you allocate an int on the heap, it is allocated at address 1. ... application has a given amount of memory it can use as it wishes. ...
    (alt.comp.lang.learn.c-cpp)
  • Re: run-time vs compile-time
    ... > offset related to some location (like stack base) somewhere. ... > offset from heap to pi. ... When you allocate an int on the heap, it is allocated at address 1. ... application has a given amount of memory it can use as it wishes. ...
    (comp.lang.cpp)
  • Re: heap allocation of arrays
    ... to force all arrays to be allocated on the heap. ... the stack would be replaced with pointers on the stack. ... heap is easier to detect than failure to allocate space on the ...
    (comp.lang.fortran)