delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/02/04/05:00:10

From: G DOT DegliEsposti AT ads DOT it
To: djgpp AT delorie DOT com
Message-ID: <C12565A1.0030F12E.00@vega.ads.it>
Date: Wed, 4 Feb 1998 10:00:04 +0100
Subject: Re: Re: Memory usage tracking
Mime-Version: 1.0




>  Are there any methods to check the memory amount allocated by my
> program? Under DJGPP/CWSDPMI.
>
>  It would be nice to be able to check the memory usage with a single
> keypress inside my program.
>
>  This would help a lot while developing some programs which
> allocate/free mem a lot.
I do not know methods wich are specific to djgpp/cwsdpmi (maybe there is
some __dpmi_get_allocated_memory() or something like that :-)

A very portable way is to write some wrapper functions to malloc() free()
and other functions like these.

Your wrapper functions can keep track of the memory allocated and
deallocated
and you can get the value every time you need it.

Of course you have to substitute throughout your program all instances of
malloc() with my_malloc() and so on.

ciao
  Giacomo



- Raw text -


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