Mail Archives: djgpp/1996/12/14/10:19:24
Alexey Kouzmitch wrote:
>
> Hi, can someone help me please...
> I have a main file including 3 more with #include, plus it uses Allegro...
> Well, compiles OK, runs OK, but 5.8 MEGS long with 6% of actually being
> non-zero bytes ??? Wow, I said... WHY ??? I get a bit of code (around 3%)
> in the beginning, then A LOT of zeroes (through 97%) and then some more
> Allegro info in the end... What am I missing, some switch or what??? please
> help... thanks...
Hmmm. I would guess that youve got some really large static arrays in
your code. Replace them with dynamic ones and the file size should drop
down significantly. For example:
Change this:
unsigned char big_static_array[3000000];
Into this:
unsigned char *big_dynamic_array;
.
.
.
if(NULL == (big_dynamic_array = (unsigned char *)malloc(3000000)))
{
fprintf(stderr, "Error: can't malloc()\n");
}
--
Mike A. Harris
http://www3.sympatico.ca/mharris
My dynamic address:
http://www3.sympatico.ca/mharris/ip-address.html
mailto:mharris AT sympatico DOT ca
mailto:mharris AT blackwidow DOT saultc DOT on DOT ca
The Ultimate: Linux 2.0.26, DOSemu, 4DOS 5.50c, DJGPP 2.01, Borland C
3.1
- Raw text -