home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / aix / 8188 < prev    next >
Encoding:
Text File  |  1992-07-25  |  1.5 KB  |  43 lines

  1. Newsgroups: comp.unix.aix
  2. Path: sparky!uunet!sun-barr!cs.utexas.edu!torn!newshost.uwo.ca!newshost.uwo.ca!oink
  3. From: oink@newshost.uwo.ca (Test Account)
  4. Subject: Re: SUMMARY: dbx problems
  5. Organization: The University of Western Ontario, London, Canada.
  6. Date: Sun, 26 Jul 1992 08:37:41 GMT
  7. Message-ID: <OINK.92Jul26033741@julian.newshost.uwo.ca>
  8. In-Reply-To: marca@void.ncsa.uiuc.edu's message of 24 Jul 92 00:23:41 GMT
  9. References: <1992Jul23.202224.29736@ief.itg.ti.com> <BrvAFJ.6oM@news.cso.uiuc.edu>
  10. Sender: news@julian.uwo.ca (USENET News System)
  11. Nntp-Posting-Host: julian.uwo.ca
  12. Lines: 29
  13.  
  14. In article <BrvAFJ.6oM@news.cso.uiuc.edu> marca@void.ncsa.uiuc.edu (Marc Andreessen) writes:
  15.  
  16.    I believe).  Also, 3.1 malloc would clear all memory it allocated to 0; 
  17.    3.2 malloc does not.  (Normally, malloc isn't supposed to do this -
  18.    but calloc is.)
  19.  
  20. My experience has shown that this is simply not true. Although it probably is
  21. true of malloc()ed memory from the heap, it is certainly NOT true of recently
  22. free()ed amd re-malloc()ed memory. Certainly not something to count on!
  23.  
  24. Actually, the big change that I did not expect with the new malloc behaviour
  25. is that free()ed memory is no longer valid. Many programmers (for historical
  26. reasons I guess) assume that constructs like the following should work:
  27.  
  28.     while (ptr) {
  29.         free(ptr);
  30.         ptr = ptr->next;
  31.     }
  32.  
  33. This will not work under with MALLOCTYPE=3.2 environment (and IMHO it 
  34. should never have worked, but that is another argument). 
  35.  
  36.    Hope this helps,
  37.  
  38. And this,
  39.  
  40.    Marc
  41.  
  42. cheerskinch
  43.