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