[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070326080908.GF9144@frankl.hpl.hp.com>
Date: Mon, 26 Mar 2007 00:09:08 -0800
From: Stephane Eranian <eranian@....hp.com>
To: Folkert van Heusden <folkert@...heusden.com>
Cc: Vignesh Babu BM <vignesh.babu@...ro.com>,
linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
ak@...e.de, Jan Engelhardt <jengelh@...ux01.gwdg.de>
Subject: Re: kmalloc() with size zero
Hi,
On Sun, Mar 25, 2007 at 06:30:34PM +0200, Folkert van Heusden wrote:
> > > I'd say "feature", glibc's malloc also returns an address on
> > > malloc(0).
> > >
> > This is implementation defined-the standard allows for return of either
> > null or an address.
>
> Entirely for entertainment: AIX (5.3) returns NULL, IRIX returns a valid
> address.
>
That's interesting, so many different behaviors! Personally, I still prefer
when malloc(0) returns zero because it makes it easier to catch errors.
--
-Stephane
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists