home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 1683 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

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