www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/11/22/16:31:39

From: "Tony O'Bryan" <aho450s AT nic DOT smsu DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Excessive exe sizes
Date: Sat, 22 Nov 1997 14:02:21 -0600
Organization: Southwest Missouri State University
Lines: 32
Message-ID: <34773A4D.37DE@nic.smsu.edu>
References: <01bcf777$71921820$56f682c1 AT nicland>
Reply-To: aho450s AT nic DOT smsu DOT edu
NNTP-Posting-Host: sara.a49.smsu.edu
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Nicholas Law wrote:
> 
> Hi all!
> 
> I've got a problem in DJCPP V2.01:
> 
> I've got the following code just ahead of my main function
> 
> struct look_up_table{
> int line_length;
> int x[640];
> int y[640];
> };
> 
> look_up_table lut[480];
> 
> When I compile my program it produces an excessive .exe - 2.7Mb from source
> files of about 40Kb! The .o file is 2.6Mb. When I looked at the .exe and
> the .o I found they were mostly blank space.

That looks right.  Look at your data:

struct look_up_table breaks down like this:
	int line_length = 4 bytes
	int x[640] = 2560 bytes
	int y[640] = 2560 bytes
	===========================
	total = 5124 bytes

look_up_table[480] = 5124 bytes * 480 = 2,459,520 bytes (2.4 megs)

2.4 megs + startup code could easily bring the size to 2.7 megs.

- Raw text -


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