[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-gcc
Subject:    Re: Big variables problem
From:       linas () linas ! org
Date:       1999-11-17 15:51:42
[Download RAW message or body]

It's been rumoured that Rafael Marco de Lucas said:
> 
> 
>     Hello, i found that the following program gives an error, why ?
>  is there any limit in the size of variables ?
> 
>       main () {
>       int i;
>       float jajaja[1000000][300];
>       i=1;
>       sleep(1);
>       }
> 
>   i tried it compiling with gcc on as linux pc and a digital unix4 machines,
>  and it only worked using the cc dec compiler,

jaja stits on the stack, not the heap.  

You need to increase the size of your stack space with teh 'ulimit'
command.   It's also possible that the sysadmin set a hard limit 
at 8meg or 24 meg. in which case you need the sysadmins help to raise
it.

You can try using malloc to put it on the heap or try 
'static float jaja[10000]' to put it in the bss.

--linas

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic