All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bill Davidsen <davidsen@tmr.com>
To: eranian@hpl.hp.com
Cc: Folkert van Heusden <folkert@vanheusden.com>,
	Vignesh Babu BM <vignesh.babu@wipro.com>,
	linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
	ak@suse.de, Jan Engelhardt <jengelh@linux01.gwdg.de>
Subject: Re: kmalloc() with size zero
Date: Thu, 29 Mar 2007 10:39:10 -0400	[thread overview]
Message-ID: <460BCF8E.7030705@tmr.com> (raw)
In-Reply-To: <20070326080908.GF9144@frankl.hpl.hp.com>

Stephane Eranian wrote:
> 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.
> 
Exactly, the address returned is not really useful, the improved error 
checking is useful.

-- 
Bill Davidsen <davidsen@tmr.com>
   "We have more to fear from the bungling of the incompetent than from
the machinations of the wicked."  - from Slashdot

  reply	other threads:[~2007-03-29 14:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-23  0:18 kmalloc() with size zero Stephane Eranian
2007-03-23  1:38 ` Jan Engelhardt
2007-03-23  4:39   ` Vignesh Babu BM
2007-03-25 16:30     ` Folkert van Heusden
2007-03-26  8:09       ` Stephane Eranian
2007-03-29 14:39         ` Bill Davidsen [this message]
2007-03-23 15:12 ` Christoph Lameter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=460BCF8E.7030705@tmr.com \
    --to=davidsen@tmr.com \
    --cc=ak@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=eranian@hpl.hp.com \
    --cc=folkert@vanheusden.com \
    --cc=jengelh@linux01.gwdg.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vignesh.babu@wipro.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.