Cc: Christoph Lameter <clameter@...>, Satyam Sharma <satyam@...>, Andrew Morton <akpm@...>, Arjan van de Ven <arjan@...>, Tim Bird <tim.bird@...>, linux kernel <linux-kernel@...>
On 8/18/07, Thomas Gleixner <tglx@linutronix.de> wrote:
Well, kmalloc(0) has always been legal and traditionally returned a
pointer to a smallest non-zero sized object. We did try to make
kmalloc(0) illegal for a while but ended up fixing up a bunch of
call-sites for little or no gain. I did propose that kmalloc(0) should
return NULL but Linus and others pointed out that we can do better and
not mix up out-of-memory and zero-sized allocations.
-