delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/08/15:40:05

Message-Id: <m0xIwGo-000S23C@inti.gov.ar>
Comments: Authenticated sender is <salvador AT natacha DOT inti DOT gov DOT ar>
From: "Salvador Eduardo Tropea (SET)" <salvador AT inti DOT edu DOT ar>
Organization: INTI
To: Herman Geza <hg211 AT hszk DOT bme DOT hu>, djgpp AT delorie DOT com
Date: Wed, 8 Oct 1997 16:47:26 +0000
MIME-Version: 1.0
Subject: Re: Compiler crashes...

Lantic wrote:
> 
> 	My problem is very simple: I wrote a program which converts
> 	bin files to C files. These C programs are perfect, they only
> 	contain an array. If this array is small, about smaller than
> 	100.000 bytes, there is no problem. But, if it's bigger, the
> 	compiler crashes with SIGSEGV. I used the option -v with
> 	gcc, and I realized that the compiler wasn't able to make
> 	the assembly file. A temporary file was made, and this file
> 	contained about half of my array. I used CWSDPMI and I have
> 	enough memory and winchester space. The TMP env was set right.
> 
> 	So, I think everything was right, but the compiler crashed.
> 	Please, HELP me!
> 
Bad news:
GCC doesn't support big arrays with initialization, like this:

char XXX[100000]={ 1,2,....
...
... 99999 };

The compiler will crash or if you have luck (like I have) it will report out of 
virtual memory. Seems that gcc uses MUCH more memory for this that what we can 
think. For example: 300000 elements needs more than 40Mb.

You can:
1) Avoid it in the code. You can attach the data to the exe or better load it 
from a file.
2) Make it in small arrays.

SET
------------------------------------ 0 --------------------------------
Visit my home page: http://www.geocities.com/SiliconValley/Vista/6552/
Salvador Eduardo Tropea (SET). (Electronics Engineer)
Alternative e-mail: set-sot AT usa DOT net - ICQ: 2951574
Address: Curapaligue 2124, Caseros, 3 de Febrero
Buenos Aires, (1678), ARGENTINA
TE: +(541) 759 0013

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019