home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / os / msdos / programm / 10386 < prev    next >
Encoding:
Text File  |  1992-11-07  |  1.7 KB  |  39 lines

  1. Path: sparky!uunet!ukma!wupost!zaphod.mps.ohio-state.edu!cs.utexas.edu!devnull!pulsar!duanev
  2. From: duanev@pulsar.NoSubdomain.NoDomain (Duane Voth)
  3. Newsgroups: comp.os.msdos.programmer
  4. Subject: Re: HELP: bloated BC++ program (one of us needs relief...)
  5. Message-ID: <2800@devnull.mpd.tandem.com>
  6. Date: 6 Nov 92 16:58:50 GMT
  7. References: <22OCT199219515621@zeus.tamu.edu> <15310017@hpavla.lf.hp.com>
  8. Sender: news@devnull.mpd.tandem.com
  9. Lines: 28
  10.  
  11. In comp.os.msdos.programmer, sam4628@zeus.tamu.edu writes:
  12. > I have a small program (source below) which basically runs a COMMAND
  13. > shell.  When in this shell, I do a MEM /C | MORE to check the size of
  14. > the program, which turns out to be about 65702 bytes!!!  The executable
  15. > is only a couple of K!  For the record, the parent program which this
  16. > is distilled from is over 27K, but still takes up 65702 bytes according
  17. > to MEM.
  18.  
  19. Borland C 3.x has a couple of unsigned ints that reside in the c.obj
  20. preamble which control the amount of heap and stack resreved for the
  21. program.  The default is go get as much heap and stack as possible
  22. (values = 0).  Set them to some fixed value (4096 or so) and more of
  23. your memory will remain free.  You'll have to play with the values
  24. some - there are no good error messages produced when you make them
  25. too small - your program will probably just stop running.   Outside
  26. of all functions declare:
  27.  
  28.     extern unsigned int _heapsiz = 4096;
  29.     extern unsigned int _stacksiz = 1024;
  30.  
  31. I don't remember the exact variable names so be sure to look in the
  32. back of your Borland Programmers Guide in the section on extern variables.
  33.  
  34.  
  35. -- 
  36. --- duane voth                                  duanev@mpd.tandem.com
  37. --- ALL systems are arbitrary!  Effectiveness is the measure of Truth
  38. --
  39.