delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/04/19/04:30:25

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
Date: Fri, 19 Apr 2002 11:21:30 +0300
From: "Eli Zaretskii" <eliz AT is DOT elta DOT co DOT il>
Sender: halo1 AT zahav DOT net DOT il
To: "R. Grela" <rgrela AT ciudad DOT com DOT ar>
Message-Id: <3998-Fri19Apr2002112129+0300-eliz@is.elta.co.il>
X-Mailer: emacs 21.2.50 (via feedmail 8 I) and Blat ver 1.8.9
CC: djgpp AT delorie DOT com
In-reply-to: <4.3.2.7.2.20020419032335.00bb6378@mail.ciudad.com.ar>
(rgrela AT ciudad DOT com DOT ar)
Subject: Re: Testing for memory leaks
References: <4 DOT 3 DOT 2 DOT 7 DOT 2 DOT 20020419032335 DOT 00bb6378 AT mail DOT ciudad DOT com DOT ar>
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> Date: Fri, 19 Apr 2002 03:45:31 -0300
> From: "R. Grela" <rgrela AT ciudad DOT com DOT ar>
> 
> I'm writing a class that uses pointers and I want to check if all of them 
> are destroyed correctly, so I'm looking for a function that gives me some 
> information about the memory available or memory used to check if at the 
> program starts and the program ends the memory available is exactly equal.

There's nothing in the released version of DJGPP 2.03 to provide this
functionality.  The development sources in the CVS have a function
called `mallinfo' that reports the current heap usage.  You could
download the modified malloc.c and the new malldbg.c modules from the
CVS tree (via the anon CVS access) and use them in your program.

> I don't know how memory management is implemented in programs compiled with 
> djgpp, I've looked the _go32_dpmi_get_free_memory_information function in 
> go32.h but I've make a test to get that information before and after making 
> MyObject* obj = new MyObject; and I get the same results viewing the field 
> available_physical_pages in _go32_dpmi_meminfo structure.

This is expected: DJGPP never returns memory to the OS.  See section
15.2 of the DJGPP FAQ list for more details about this.

- Raw text -


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