delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/11/25/07:15:28

Date: Tue, 25 Nov 1997 14:14:10 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: sl <SL AT usemail DOT com>
cc: DJGPP mailing list <djgpp AT delorie DOT com>,
Paul Derbyshire <ao950 AT FreeNet DOT Carleton DOT CA>
Subject: Re: Excessive exe sizes
In-Reply-To: <199711250232.VAA28286@delorie.com>
Message-ID: <Pine.SUN.3.91.971125141319.27505Y-100000@is>
MIME-Version: 1.0

On Mon, 24 Nov 1997, sl wrote:

> >If you allocate the array dynamically at run-time at the start of main()
> >then you will have a reasonable .exe size and equivalent function.
> 
> 	That is the dumbest thing I have ever heard.
                    ^^^^^^^
Please refrain from calling replies posted by others as ``dumb''.
People who offer free help here don't deserve it, even if they are
dead wrong.  It is okay to correct somebody's message, but flaming
them for offering help is something we should try to avoid.

> You are allocating MEMORY here, not diskspace!

Nevertheless, Paul's suggestion *does* make sense: by switching from
statically allocated array to one that's allocated at run time, the
disk image doesn't get bloated by the initialized array.

> Regardless of if you allocate the array staticly or dynamically it
> should NOT use up diskspace!

This cannot be done in all cases.  For example, if the array is
initialized by values other than zeroes, the linker has no other way
than to write all those values into the disk .exe file.

- Raw text -


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