Mail Archives: djgpp/1996/05/12/01:16:25
> How do I verify that my program have released all memory I have allocated?
> I have tried following procedure, but without success:
> mem/c >mem1.log
> my_program.exe
> mem/c >mem2.log
> mem1.log is equivalent of mem2.log even if I don't use free() in my program!
I'm not sure how it works under multitasking (Windows, etc.), but as
far as I know, under DOS, you only need to worry about calling free()
when you need to get rid of some memory in mid-program to use it for
something else.. all allocations are tracked, and freed when the
program quits.
However, you should keep track of everything you allocate, and free
it all (usually in reverse order) as part of an organised programming
style (maybe that's why you were asking though ... =)
--
Lee Braiden (lee_b AT celestia DOT dnet DOT co DOT uk)
<Celestia>
- Raw text -