delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/25/15:59:10

Date: Tue, 25 Aug 1998 15:18:03 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Cláudio André Heckler <heckler AT mat DOT ufrgs DOT br>
cc: djgpp AT delorie DOT com
Subject: Re: Need to know free memory
In-Reply-To: <35E15D6D.822A850A@mat.ufrgs.br>
Message-ID: <Pine.SUN.3.91.980825151737.7520d-100000@is>
MIME-Version: 1.0

On Mon, 24 Aug 1998, Cláudio André Heckler wrote:

> 	This way, when I free memory, I don't see any change in
> the value returned by _go32_dpmi_get_free_memory_information.
> So, how can I calculate the REAL amount of free memory that I
> can use ?

The question is: what would you like your program to do when it runs
out of physical RAM?  Given the answer to that, a solution to your
dilemma could probably be found.

For example, if all you want is to print a message and exit, or
prevent the user from doing something, then disabling virtual memory
and checking values returned by `malloc' and friends against NULL
would be sufficient.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019