🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: system() memory usage under Turbo C

#7058
From: Ralf.Brown
Date: Mon, 10 Jun 1991 11:37
30 lines
1685 bytes
In article <22566@ogicse.ogi.edu>, francis@atmos.cse.ogi.edu (Francis Moraes) wrote:
}I compiled the following program using Turbo C under all of its memory
}models:
}
}main()
}{
}   system("vtsr");
}}
}
}Vtsr is a program that lists the programs in memory and the amount of memory
}allocated to it. The amount of memory in kilobytes used by this program are
}given below for each of the memory models:
}[omitted]
}
}I think it is interesting that the memory models that use far pointers for
}data have smaller memory usage than those with near data pointers. Does anyone
}know why this is so?  The same problem exists with the exec() function. I

That's the effect of the near heap.  Add the line

       _heaplen = 100 ;

at the beginning of the program and watch the memory use drop.	(You may
have to increase the value if system() needs more than 100 bytes of heap).

-- 
{backbone}!cs.cmu.edu!ralf  ARPA: RALF@CS.CMU.EDU   FIDO: Ralf Brown 1:129/53
BITnet: RALF%CS.CMU.EDU@CARNEGIE   AT&Tnet: (412)268-3053 (school)   FAX: ask
DISCLAIMER?  Did  | It isn't what we don't know that gives us trouble, it's
I claim something?| what we know that ain't so.  --Will Rogers
Technical Details
Message-ID: <28536495@ralf>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!spool.mu.edu!think.com!rpi!batcomputer!cornell!rochester!pt.cs.cmu.edu!ralf

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!spool.mu.edu!think.com!rpi!batcomputer!cornell!rochester!pt.cs.cmu.edu!ralf
From: Ralf.Brown@B.GP.CS.CMU.EDU
Newsgroups: comp.os.msdos.programmer
Subject: Re: system() memory usage under Turbo C
Message-ID: <28536495@ralf>
Date: 10 Jun 91 11:37:57 GMT
Organization: Carnegie Mellon University School of Computer Science
Lines: 30
In-Reply-To: <22566@ogicse.ogi.edu>
Originator: ralf@B.GP.CS.CMU.EDU