Xref: utzoo comp.sys.ibm.pc:35471 comp.lang.c:22363 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!tut.cis.ohio-state.edu!pt.cs.cmu.edu!b.gp.cs.cmu.edu!Ralf.Brown@B.GP.CS.CMU.EDU From: Ralf.Brown@B.GP.CS.CMU.EDU Newsgroups: comp.sys.ibm.pc,comp.lang.c Subject: Re: Microsoft C - Heap space question Message-ID: <2522052c@ralf> Date: 28 Sep 89 11:49:00 GMT Sender: ralf@b.gp.cs.cmu.edu Organization: Carnegie Mellon University School of Computer Science Lines: 29 In-Reply-To: <14792@netnews.upenn.edu> In article <14792@netnews.upenn.edu>, catone@dsl.cis.upenn.edu (Tony Catone) wrote: >In article <4143@csd4.csd.uwm.edu> chad@csd4.csd.uwm.edu (D. Chadwick Gibbons) writes: >> One very important note about farmalloc: usually, it will grab memory >>that was not original assigned to the executable when it ran. Therefore, upon > >Is this really true? I thought that DOS automatically allocated all free >system memory (not expanded or extended) to the currently executing program. .COM programs always get the largest available block of memory (which is all free memory unless you've managed to fragment memory by doing something like running a TSR while shelled out of another program). .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. >Does using C make a difference in this behavior? 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. -- UUCP: {ucbvax,harvard}!cs.cmu.edu!ralf -=-=-=-=- Voice: (412) 268-3053 (school) ARPA: ralf@cs.cmu.edu BIT: ralf%cs.cmu.edu@CMUCCVMA FIDO: Ralf Brown 1:129/46 FAX: available on request Disclaimer? I claimed something? "All through human history, tyrannies have tried to enforce obedience by prohibiting disrespect for the symbols of their power. The swastika is only one example of many in recent history." -- American Bar Association task force on flag burning