home *** CD-ROM | disk | FTP | other *** search
- Path: senator-bedfellow.mit.edu!red-branch!rid
- From: rid@red-branch.MIT.EDU (Shawna Grimm)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Must I free my linked lists? (GCC)
- Date: 22 Jan 1996 02:28:57 GMT
- Organization: Massachvsetts Institvte of Technology
- Message-ID: <4dusp9$7k3@senator-bedfellow.MIT.EDU>
- References: <4dudic$aif@vixen.cso.uiuc.edu>
- NNTP-Posting-Host: red-branch.mit.edu
- X-Newsreader: TIN [version 1.2 PL2]
-
- Unknown (Dannyman@uiuc.edu) typed in the following on 21 Jan 1996 22:09:16 GMT:
- : I'm writing a program that makes use of dynamic memory allocation through
- : linked lists using malloc() ... from an implementation PoV there's no need
- : to flush this stuff as after the queue is created it's output and the
- : program exits. My question is;
-
- : "When my program exits, is the dynamic memory in the queues returned to
- : the system or is a "memory hole" left, so that I should actually go back and
- : return all the memory in my program ..."
-
- Yes, you _should_ free any memory that you allocate in your program.
- Memory that is allocated and not freed will not be returned to the system
- unless you turn the machine off, so if you want your memory back, you
- must free it. Personally, I would prefer to use AllocMem() or AllocVec()
- (with FreeMem() and FreeVec() ofcourse).
-
- : Thanks. Please reply publically, because I got 20 emails on my last
- : question. No *need* for all you courteous folk to respond! :)
-
- : --
- : =====///====================================================================
- : ====///=======This message brought to you by dannyman@uiuc.edu==============
- : \\\///=========HOME PAGE! http://www.uiuc.edu/ph/www/djhoward ==============
- : =\XX/A1200==================================================================
- : "Our ship is broken. Can you make it go?"
-
-
- * Lars M. Hansen
-