home *** CD-ROM | disk | FTP | other *** search
- Path: sdd.hp.com!inn
- From: Jeff Grimmett <jgrimm@sdd.hp.com>
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Must I free my linked lists? (GCC)
- Date: 22 Jan 1996 18:28:44 GMT
- Organization: Hewlett-Packard Company
- Message-ID: <4e0l0s$2tu@news.sdd.hp.com>
- References: <4dudic$aif@vixen.cso.uiuc.edu> <4e0djj$mnh@vixen.cso.uiuc.edu>
- NNTP-Posting-Host: hpsdv330.sdd.hp.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.2N (Windows; I; 16bit)
-
- djhoward@ux4.cso.uiuc.edu (howard daniel joseph) wrote:
-
- > Now, what's the difference with AllocMem() from malloc()
-
- AllocMem() is an AmigaDOS library call, malloc() is an ANSI-C function.
- malloc() is also much more convenient than AllocMem, and this even more
- so applies to free() compared to FreeMem(). Use malloc() and calloc()
- for any code that you wish to be ANSI compliant. Use AllocMem() if you
- don't mind being tied strictly to the Amiga, and want to economize.
-
- > Also, I think that when the guy was referring to his Unix system
- >returning the memory, I was told the Unix frees the memory, but Ami
- >doesn't ...
-
- Just depends on how you do it. And as I commented earlier, I really
- recommend against trusting your compiler to clean up after you. Leads to
- sloppy code.
-
-
-