delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/01/11/04:54:14

From: "John M. Aldrich" <fighteer AT cs DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Malloc & Co.
Date: Fri, 10 Jan 1997 19:09:47 -0800
Organization: Two pounds of chaos and a pinch of salt
Lines: 24
Message-ID: <32D7047B.5643@cs.com>
References: <199701101926 DOT NAA21023 AT ginger DOT imgen DOT bcm DOT tmc DOT edu>
Reply-To: fighteer AT cs DOT com
NNTP-Posting-Host: ppp101.cs.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

David Stockton wrote:
> 
> I am not sure I agree with this statement.  Why should the user have to
> sit around and wait while some programs traverses all its arrays and
> linked lists freeing memory when it will make no difference at all?  I
> agree that keeping track of allocations and being able to free them during
> execution to prevent "core leaks" is imperitive, but before termination -
> why bother!

Normally you will never need to.  Most programmers never bother.  But
there have been documented cases of wierd things happening to programs
that cause memory not to be freed at exit, and thus mess up the host
system.  Memory leaks are the worst sort of bugs to track down.

BTW, the C FAQ mentions this subject, and recommends that you free the
memory, even if you don't need to.

-- 
---------------------------------------------------------------------
| John M. Aldrich, aka Fighteer I  |        fighteer AT cs DOT com         |
| Call me for your free AOL disk!  |   http://www.cs.com/fighteer   |
|  Chain letters, work-at-home schemes, free long distance, etc.,   |
|    are ILLEGAL!  Keep the Internet litter-free... don't SPAM.     |
---------------------------------------------------------------------

- Raw text -


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