delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/01/23:52:51

Date: Sat, 1 Mar 1997 20:49:12 -0800 (PST)
From: KaRNaGE <dlydiard AT linknet DOT kitsap DOT lib DOT wa DOT us>
To: djgpp AT delorie DOT com
Subject: Re: quick malloc question
Message-ID: <Pine.SUN.3.95.970301203741.10400A-100000@linknet.kitsap.lib.wa.us>
MIME-Version: 1.0

i remember reading the answer to this a long time ago, in a DOS
programming guide (2 years ago)...but if i recall right...ALL memory that
a program allocates (.exe/.com) under DOS will be returned, when the
program exit's.
this goes for DOS, i'm not sure about other os/s, it's better of if you
just free() all your mem before you exit the program...but as far as i
know unless you mess up something pretty bad, you'll get all your mem
back...

>I was wondering: if i allocate some memory with malloc () or an 
>equivelent
>function and then quit the program without calling free (), will this
>memory be freed automatically?

        

- Raw text -


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