www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/11/21/22:30:20

Date: Mon, 21 Nov 1994 17:49:22 -0500 (EST)
From: Kimberley Burchett <OKRA AT max DOT tiac DOT net>
Sender: Kimberley Burchett <OKRA AT max DOT tiac DOT net>
Reply-To: Kimberley Burchett <OKRA AT max DOT tiac DOT net>
Subject: huge exe -- clarify.
To: DJGPP Mailing List <djgpp AT sun DOT soe DOT clarkson DOT edu>

  Okay, this seems to be new behavior for GCC (didn't happen in 1.11).  I 
have written several programs using large 2d arrays.  For example, one 
called "satin."  It used arrays defined like this:

#define xmax 320
#define ymax 200
#define zmaxX 189
#define zmaxY 161
 
char Xarray[zmaxX][4][xmax/4];
char Yarray[zmaxY][ymax];

  The exe came out to 46k under 1.11.  However if I compile the SAME
source under 1.12, I get a 126k exe. (I assume it is a difference 'tween
1.12 and 1.11... I just know that it _used_ to work okay around when I was
using 1.11). 
  I know it's possible for the exe format to specify large chunks of 
memory that don't take up room in the exe - in assembler you'd use 
"1000000 dup (?)" I think.  These huge arrays don't make the exe any 
bigger because they're not initialized - they're filled with whatever 
memory happens to be there when the exe is loaded.  Then the program 
itself initializes them.
  I assume 1.11 used this kind of format but 1.12 doesn't.
  What I want is a way to tell the compiler to do what it used to.  I 
will NOT use a malloc'ed array since I'd have to change a lot of 
sources.
  BTW: pkzip compresses this 126k exe down to only 26k.  That's a lot of 
zeroes.
							Kim



- Raw text -


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