delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/12/15:16:03

From: firewind <firewind AT metroid DOT dyn DOT ml DOT org>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Large arrays eating disk space
Date: 12 Oct 1997 18:16:09 GMT
Organization: Netcom
Lines: 33
Message-ID: <61r459$dkh@sjx-ixn4.ix.netcom.com>
References: <Pine DOT GSO DOT 3 DOT 94 DOT 971012124635 DOT 6579A-100000 AT minerva DOT cis DOT yale DOT edu>
NNTP-Posting-Host: elp-tx2-16.ix.netcom.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

J. Hormuzdiar <jimh AT pantheon DOT yale DOT edu> wrote:

> Hello-
> 	Perhaps this question is better intended for comp.lang.c, but I am
> not sure yet.

It is not on-topic for comp.lang.c; how a compiler stores fixed-length
arrays has nothing to do with the C language.

> 	I am using a djgpp/rhide environment with a program that has some
> huge fixed size arrays.  When I compile I get an executable that is
> correspondingly huge (many meg's), even though the code is pretty small.
> I assume that the compiler is saving the whole huge blank pre-used array
> in the executable, and I wish it wouldn't.  The space is a problem, but
> even worse is the wait for the compiler to save the huge thing every time.

> 	I could just dynamically allocate using malloc, but I seem to
> remember that there is a keyword or option that will automatically do it
> for me.  Perhaps I could just add a word to the declaration-

> (word) float x[7000][7000];

If you are using C++ and are delcaring the array 'static,' adding the switch
'-fconserve-space' can help out, as described in the DJGPP FAQ, section 8.14.
Otherwise, I see no solution save dynamic allocation.

late\fw

-- 
[- 				 firewind	                            -]
[-   email: firewind AT metroid DOT dyn DOT ml DOT org (home), firewind AT aurdev DOT com (work)  -]
[- 	    "You're just jealous because the voices talk to -me-."          -]
[-                   Have a good day, and enjoy your C.		            -]

- Raw text -


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