Mail Archives: djgpp/1998/02/04/05:00:10
> 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 -