delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/15/07:15:30

Date: Wed, 15 Oct 1997 13:15:12 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: "Salvador Eduardo Tropea (SET)" <salvador AT inti DOT edu DOT ar>
cc: djgpp AT delorie DOT com
Subject: Re: GCC uses A LOT of memory to parse static arrays
In-Reply-To: <m0xL61M-000S1mC@inti.gov.ar>
Message-ID: <Pine.SUN.3.91.971015131443.17868K-100000@is>
MIME-Version: 1.0

On Tue, 14 Oct 1997, Salvador Eduardo Tropea (SET) wrote:

> Data type: unsigned chars
> Size of the array: 182,520 bytes
> Data memory used by GCC (2.7.2.1): 37,306,480
> .o file generated: 182,895 bytes

As I already told in this thread, using unsigned ints instead of
unsigned chars will allow you to reduce the dimension of the array by
a factor of 4, with similar four-fold reduction of the memory
requested by GCC, but still initialize 182,895 bytes of data.

> I got "out of virtual"!!!!!, perhaps that isn't very important because you
> don't know what go32-v2 reports in my machine:
> 
> DPMI memory available: 27435 Kb
> DPMI swap space available: 130389 Kb
> 
> So 128Mb is not enough!!

Not so quick, please.  Did you use CWSDPMI as your DPMI host?  If so,
you might need to enlarge its internal heap, because the default heap
is only enough for about 21MB of memory allocated in small chunks.  I
bumped the heap to 640 paragraphs (32KB) and got GCC to compile a
program with a larger array which required more than 60MBytes.  Did
you try to enlarge the heap?

> The conclution is very easy: NEVER use GCC for large static arrays, use AS.

I would say: never put such large arrays into the image at all.  Use
an external file.

- Raw text -


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