home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / unix / aix / 13117 < prev    next >
Encoding:
Internet Message Format  |  1993-01-07  |  1.3 KB

  1. Path: sparky!uunet!cs.utexas.edu!uwm.edu!ogicse!das-news.harvard.edu!cantaloupe.srv.cs.cmu.edu!crabapple.srv.cs.cmu.edu!andrew.cmu.edu!jz1j+
  2. From: jz1j+@andrew.cmu.edu (James D. Zelenka)
  3. Newsgroups: comp.unix.aix
  4. Subject: Re: malloc(0) fails on AIX and nowhere else I could find ...
  5. Message-ID: <ofH=OfC00hYzAC559H@andrew.cmu.edu>
  6. Date: 7 Jan 93 13:03:07 GMT
  7. Article-I.D.: andrew.ofH=OfC00hYzAC559H
  8. References: <93Jan7.012526est.169557-2@watdragon.uwaterloo.ca>
  9.     <C0HCs4.Eoy@axion.bt.co.uk>
  10. Organization: Junior, Math/Computer Science, Carnegie Mellon, Pittsburgh, PA
  11. Lines: 15
  12. MIME-Version: 1.0
  13. Content-type: text/plain; charset=US-ASCII
  14. In-Reply-To: <C0HCs4.Eoy@axion.bt.co.uk>
  15.  
  16. Excerpts from netnews.comp.unix.aix: 7-Jan-93 Re: malloc(0) fails on AIX
  17. .. Neil Winton@axion.bt.co. (1745)
  18.  
  19. > Pardon?  What do you mean `it works'?  Sure it returns a non-null pointer but
  20. > what are you going to do with that?  You asked for no space to be allocated so
  21. > how are you going to use that pointer-to-nothing?
  22.  
  23. The most standard use I know of for malloc(0) is to get a pointer that
  24. can be passed to realloc(). In any case, this behavior of the AIX malloc
  25. package is documented, and can be changed with mallopt, which is just
  26. about all you can ask for in an operation whose results are defined as
  27. implementation-specific.
  28.  
  29. -Jim Zelenka
  30. jz1j@andrew.cmu.edu
  31.