Xref: utzoo comp.sys.ibm.pc:35491 comp.lang.c:22375 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!ames!ncar!unmvax!bbx!bbxsda!scott From: scott@bbxsda.UUCP (Scott Amspoker) Newsgroups: comp.sys.ibm.pc,comp.lang.c Subject: Re: Microsoft C - Heap space question Message-ID: <186@bbxsda.UUCP> Date: 29 Sep 89 15:40:15 GMT References: <2522052c@ralf> Reply-To: scott@bbxsda.UUCP (Scott Amspoker) Organization: Basis International, Albuquerque, NM Lines: 25 In article <2522052c@ralf> Ralf.Brown@B.GP.CS.CMU.EDU writes: >In article <14792@netnews.upenn.edu>, catone@dsl.cis.upenn.edu (Tony Catone) wrote: >.EXEs get the amount of memory requested in their header info, which is >usually specified as FFFFh paragraphs (all available memory), but can be >changed by a utility such as EXEMOD. It is considered good programming practice under DOS to return unneeded memory to the system when your program starts up. .COMs typically get all of memory for historical reasons. Such programs frequently just assume they have all of memory. .EXEs are smarter but, as Tony Catone says, usually get all of memory anyway. >At least the Turbo C startup code (before main() is reached) adjusts the >program's memory block to use only the required memory, even though it >might initially have been given all of memory. This is true. I use Turbo C myself. I would hope that Microsoft C also did this since the system() library call wouldn't work. To require the programmer to explicity deallocate memory at startup would not be consistent with the "spirit of C". -- Scott Amspoker Basis International, Albuquerque, NM (505) 345-5232