Xref: news2.mv.net comp.os.msdos.djgpp:3897 From: Shawn Hargreaves Newsgroups: comp.os.msdos.djgpp Subject: Re: alternative to BC coreleft() ? (or coreused ()) Date: Wed, 15 May 1996 10:22:13 +0100 Organization: The University of York, UK Lines: 27 Message-ID: NNTP-Posting-Host: tower.york.ac.uk Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII In-Reply-To: <31989F6D.7E297A16@alcyone.com> To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp On Tue, 14 May 1996, Erik Max Francis wrote: > Eli Zaretskii wrote: > > > What DJGPP does let you know is the amount of memory that was not yet > > requested by the application from the DPMI server. Check out the > > functions that report free physical RAM and available virtual memory. > > Since he was asking about Borland C's coreleft, I think this really is > what he meant to ask for. But in a real life situation these functions are pretty useless, for several reasons. If you check the amount of available memory, call malloc(1024*1024*1024), and check the free memory size again, it won't change very much, at least under cwsdpmi. The memory isn't actually allocated until you touch it, which means the free space reporting can give some weird results. Also, under a multitasking OS, other apps will use both physical and virtual ram, so the amount free may change unpredictably without you doing anything to it. /* * Shawn Hargreaves. Why is 'phonetic' spelt with a ph? * Check out Allegro and FED on http://www.york.ac.uk/~slh100/ */