delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/09/08/01:21:30

Message-Id: <199709080519.PAA08312@rabble.uow.edu.au>
Subject: Reporting free heap memory
To: djgpp AT delorie DOT com (DJGPP)
Date: Mon, 8 Sep 1997 15:19:42 +1000 (EST)
From: *** Brett *** <bporter AT rabble DOT uow DOT edu DOT au>
MIME-Version: 1.0

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 :)

I think RHIDE does this alright, but it only shows it in Mb -> not enough
precision to really know (and I can't download anyhting bigger than a floppy
disk anymore because of Uni.'s computer restrictions :( so the RHIDE source
is unavailable)

Anyone able to help here? I don't think there is a built in DJGPP function
like coreleft() in other compilers (which didn't work very well anyway), but
if there is point me in the right direction, otherwise can you please help
me write a routine to do this!

MAny thanx
Brett

-- 
Brett Porter
bporter AT rabble DOT uow DOT edu DOT au

http://www.geocities.com/CollegePark/Union/3596
	Humour, Programming, and more.

- Raw text -


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