From: Thomas Demmer Newsgroups: comp.os.msdos.djgpp Subject: Re: Reporting free heap memory Date: Mon, 08 Sep 1997 09:19:59 +0200 Organization: Lehrstuhl fuer Stroemungsmechanik Lines: 39 Message-ID: <3413A71F.E770614D@LSTM.Ruhr-UNI-Bochum.De> References: <199709080519 DOT PAA08312 AT rabble DOT uow DOT edu DOT au> NNTP-Posting-Host: c64.lstm.ruhr-uni-bochum.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk *** Brett *** wrote: > > Hello everyone! > > Okay, who would like to help me this time? > > I'm writing a program that is primarily for my own use. I would like to know > _exactly_ how much free memory is left. Not how much physical RAM etc., just > one that decrements 200 when I malloc something that big or use new on > something that big. And also knows that when I free() it or delete it, the > memory must be added back on. > > I want this because I need to know if my memory is leaking somewhere (making > a local pointer 'new', then not deleting it and it goes out of scope...) > > I could just provide wrappers to the existing alloc functions to increment > and decrement a global variable, but that would then misrepresent how much > is actually free ('cause I know malloc and the rest cheat sometimes :) [...] You might check sentinel, Juan Jesus Alcolea Picazo, posted an announce a week ago, or so. It is for C++, but as you mentioned new... I lost the URL where to download it, so check out the mail archives or mail him: a920101 AT zipi DOT fi DOT upm DOT es HTH -- Ciao Tom ************************************************************* * Thomas Demmer * * Lehrstuhl fuer Stroemungsmechanik * * Ruhr-Uni-Bochum * * Universitaetsstr. 150 * * D-44780 Bochum * * Tel: +49 234 700 6434 * * Fax: +49 234 709 4162 * * http://www.lstm.ruhr-uni-bochum.de/~demmer * *************************************************************