[Skiboot] [PATCH] mambo: Add NULL checks and error messages

Alastair D'Silva alastair at au1.ibm.com
Mon Jul 11 14:37:39 AEST 2016


 <1468210380.4705.10.camel at au1.ibm.com>
	 <1468210673.4705.11.camel at au1.ibm.com>
	 <ffa2bb95-3584-08b6-511c-1498571c637f at au1.ibm.com>
Organization: IBM Australia
Content-Type: text/plain; charset="UTF-8"
X-Mailer: Evolution 3.20.3 (3.20.3-1.fc24) 
Mime-Version: 1.0
Content-Transfer-Encoding: 8bit


On Mon, 2016-07-11 at 14:25 +1000, Andrew Donnellan wrote:
> On 11/07/16 14:17, Alastair D'Silva wrote:
> > My bad, this is permitted in glibc (not necessarily others).
> 
> skiboot, of course, implements its own malloc/free :) See 
> core/{malloc,mem_region}.c, which (I checked!) define free(NULL) 
> appropriately.
> 
> (curious which other C libraries have different behaviour... POSIX 
> defines free(NULL) as a no-op.)

I'm fact checking now as to why I though it was necessary - it's
certainly defined behaviour in C99 & C89.

I suspect I may have absorbed some incorrect information at some point
:)

-- 
Alastair D'Silva
Open Source Developer
Linux Technology Centre, IBM Australia
mob: 0423 762 819



More information about the Skiboot mailing list