home *** CD-ROM | disk | FTP | other *** search
- 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+
- From: jz1j+@andrew.cmu.edu (James D. Zelenka)
- Newsgroups: comp.unix.aix
- Subject: Re: malloc(0) fails on AIX and nowhere else I could find ...
- Message-ID: <ofH=OfC00hYzAC559H@andrew.cmu.edu>
- Date: 7 Jan 93 13:03:07 GMT
- Article-I.D.: andrew.ofH=OfC00hYzAC559H
- References: <93Jan7.012526est.169557-2@watdragon.uwaterloo.ca>
- <C0HCs4.Eoy@axion.bt.co.uk>
- Organization: Junior, Math/Computer Science, Carnegie Mellon, Pittsburgh, PA
- Lines: 15
- MIME-Version: 1.0
- Content-type: text/plain; charset=US-ASCII
- In-Reply-To: <C0HCs4.Eoy@axion.bt.co.uk>
-
- Excerpts from netnews.comp.unix.aix: 7-Jan-93 Re: malloc(0) fails on AIX
- .. Neil Winton@axion.bt.co. (1745)
-
- > Pardon? What do you mean `it works'? Sure it returns a non-null pointer but
- > what are you going to do with that? You asked for no space to be allocated so
- > how are you going to use that pointer-to-nothing?
-
- The most standard use I know of for malloc(0) is to get a pointer that
- can be passed to realloc(). In any case, this behavior of the AIX malloc
- package is documented, and can be changed with mallopt, which is just
- about all you can ask for in an operation whose results are defined as
- implementation-specific.
-
- -Jim Zelenka
- jz1j@andrew.cmu.edu
-