This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Memory Allocation Problem
Hi Eljay,
I've just discovered that the problem is not with the declaration
(compiling and running the program in Linux RH8 with gcc 3.2).
I have run the program in a Terminal Window under Gnome GUI and a
Non-GUI environment (basically Ctrl+Alt+F2 and F7).
The program works well under GUI terminal, but fails with a seg
violation in non-gui environment).
Further I traced that the program was working past the assignment
statement "a[1449][0] = 999.343" (or something similar). It was sev
faulting when Im trying to pass this value to a function (printf or any
other user-defined function). Thats what I dont understand....
_Harsha_
Eljay Love-Jensen wrote:
Hi Ankit,
Your OS probably does not provide that many megabytes of STACK space.
Allocate your enormous 2-dimensional array on the HEAP or in the BSS or
in the DATA areas instead.
Or check out if your can adjust the size of your STACK to around 32 MB.
That might be a linker option. Depends on your OS.
HTH,
--Eljay