🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.msdos.programmer
Article #3371

Re: HELP: bloated BC++ program (one of us needs relief...)

#3371
From: Duane Voth
Date: Fri, 06 Nov 1992 16:58
28 lines
1788 bytes
In comp.os.msdos.programmer, sam4628@zeus.tamu.edu writes:
> I have a small program (source below) which basically runs a COMMAND
> shell.  When in this shell, I do a MEM /C | MORE to check the size of
> the program, which turns out to be about 65702 bytes!!!  The executable
> is only a couple of K!  For the record, the parent program which this
> is distilled from is over 27K, but still takes up 65702 bytes according
> to MEM.

Borland C 3.x has a couple of unsigned ints that reside in the c.obj
preamble which control the amount of heap and stack resreved for the
program.  The default is go get as much heap and stack as possible
(values = 0).  Set them to some fixed value (4096 or so) and more of
your memory will remain free.  You'll have to play with the values
some - there are no good error messages produced when you make them
too small - your program will probably just stop running.   Outside
of all functions declare:

	extern unsigned int _heapsiz = 4096;
	extern unsigned int _stacksiz = 1024;

I don't remember the exact variable names so be sure to look in the
back of your Borland Programmers Guide in the section on extern variables.


-- 
--- duane voth                                  duanev@mpd.tandem.com
--- ALL systems are arbitrary!  Effectiveness is the measure of Truth
--
Technical Details
Message-ID: <2800@devnull.mpd.tandem.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!ukma!wupost!zaphod.mps.ohio-state.edu!cs.utexas.edu!devnull!pulsar!duanev
References: <22OCT199219515621@zeus.tamu.edu> <15310017@hpavla.lf.hp.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!ukma!wupost!zaphod.mps.ohio-state.edu!cs.utexas.edu!devnull!pulsar!duanev
From: duanev@pulsar.NoSubdomain.NoDomain (Duane Voth)
Newsgroups: comp.os.msdos.programmer
Subject: Re: HELP: bloated BC++ program (one of us needs relief...)
Message-ID: <2800@devnull.mpd.tandem.com>
Date: 6 Nov 92 16:58:50 GMT
References: <22OCT199219515621@zeus.tamu.edu> <15310017@hpavla.lf.hp.com>
Sender: news@devnull.mpd.tandem.com
Lines: 28