home *** CD-ROM | disk | FTP | other *** search
- Path: 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
-
- 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
- --
-