www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/05/12/01:16:25

Message-Id: <199605120509.BAA21335@delorie.com>
Comments: Authenticated sender is <lb8412 AT mailhost DOT dnet DOT co DOT uk>
From: "Lee Braiden" <lee_b AT celestia DOT dnet DOT co DOT uk>
Organization: Celestia
To: djgpp AT delorie DOT com
Date: Sun, 12 May 1996 06:08:50 +0
Subject: Re: calloc() and free() - help!
Reply-to: lee_b AT celestia DOT dnet DOT co DOT uk

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


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