delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1994/12/26/05:36:40

To: David Goldschmidt <gold AT ccr-p DOT ida DOT org>
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: re-post
Date: Mon, 26 Dec 94 11:56:40 +0200
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>

> Can someone remind me how a function finds out how much heap space is
> available?  My code is doing a lot of new/delete operations, and it looks like
> I have to keep track of this.

A clarification of your specific need is due, because DJGPP gives
you virtual memory, so in theory you have 256 MBytes of heap space,
limited only by your free disk space.  If you want to know how much
free *physical* memory is left, before your program starts paging
to disk, there is _go32_dpmi_remaining_physical_memory() function
which will return you that info.

On the other hand, if you need to know how much memory is left in
the pages which were already allocated and then freed (they are
not returned to the system, so the above call won't count them),
then I think you will have to hack memory-allocation routines, there
is nothing AFAIK like the Borland's heap_left() and heap_walk().

- Raw text -


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