Path: utzoo!attcan!uunet!husc6!bloom-beacon!ZERMATT.LCS.MIT.EDU!RWS From: RWS@ZERMATT.LCS.MIT.EDU (Robert Scheifler) Newsgroups: comp.windows.x Subject: MALLOC_0_RETURNS_NULL Message-ID: <19880617120851.3.RWS@KILLINGTON.LCS.MIT.EDU> Date: 17 Jun 88 12:08:00 GMT References: <94.8806170546@latlog.co.uk> Sender: daemon@bloom-beacon.MIT.EDU Organization: The Internet Lines: 26 Date: Fri, 17 Jun 88 06:46:55 -0100 From: mcvax!latlog!PAYNE@uunet.uu.net Is there any reason why this exists and why it is not defined? It exists because not all systems work the same way for malloc(0). Handling NULL incurs an expense on all mallocs, and since V11R2 has primarily been installed on BSD based systems rather than SVID compliant systems, it was turned off by default. (Also, it was put in at the last minute before R1 shipped, and hadn't been tested, and was mostly forgotten about since.) Having spent two days tracking this down it is very frustrating to find that this non-standard behaviour is the reason. Unfortunately, there is more than one "standard" here. You won't find this behavior documented in most BSD based documentation. Is this feature documented anywhere? Probably not. If it is not (and I couldn't find it) it certainly ought to be? Yup.