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

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!howland.reston.ans.net!usc!cs.utexas.edu!unisql!wrat
  2. From: wrat@unisql.UUCP (wharfie)
  3. Newsgroups: comp.unix.aix
  4. Subject: Re: malloc(0) fails on AIX and nowhere else I could find ...
  5. Message-ID: <4519@unisql.UUCP>
  6. Date: 12 Jan 93 23:44:37 GMT
  7. References: <93Jan7.012526est.169557-2@watdragon.uwaterloo.ca> <1iv50gINNaih@life.ai.mit.edu>
  8. Organization: UniSQL, Inc., Austin, Texas, USA
  9. Lines: 15
  10.  
  11. In article <1iv50gINNaih@life.ai.mit.edu> mycroft@hal.gnu.ai.mit.edu (Charles Hannum) writes:
  12. >> Trying to malloc() 0 bytes on AIX fails, [...]
  13. >It does *not* fail; it returns NULL.  Your only problem is that you do
  14. >not recognize the difference.
  15.  
  16.     Well, uhh, not really.  On most?...many?... other platforms
  17. malloc() only returns NULL if it couldn't allocate the requested block.
  18. The fact that AIX malloc doesn't is technically legal but a pain...  Lots
  19. of code checks for out of memory conditions with if (!malloc(foo))
  20.  
  21. >GNU malloc() does the same thing, BTW.
  22.  
  23.     Nope.  At least, the version I have doesn't...
  24.  
  25.  
  26.