qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Cc: "Stefan Hajnoczi" <stefanha@gmail.com>,
	"Zhi Hui Li" <zhihuili@linux.vnet.ibm.com>,
	zhihuili@cn.ibm.com, 陳韋任 <chenwj@iis.sinica.edu.tw>,
	QEMU-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] some questions about g_malloc in qemu
Date: Thu, 15 Dec 2011 11:44:33 +0100	[thread overview]
Message-ID: <4EE9CF91.80701@redhat.com> (raw)
In-Reply-To: <20111215101939.GA7666@stefanha-thinkpad.localdomain>

Am 15.12.2011 11:19, schrieb Stefan Hajnoczi:
> On Thu, Dec 15, 2011 at 11:02:39AM +0100, Kevin Wolf wrote:
>> Am 15.12.2011 10:36, schrieb Stefan Hajnoczi:
>>> On Thu, Dec 15, 2011 at 04:28:28PM +0800, 陳韋任 wrote:
>>>>  I found this in HACKING:
>>>>
>>>>   Please note that NULL check for the g_malloc result is redundant and
>>>>   that g_malloc() call with zero size is not allowed.
>>>
>>> So we have:
>>>
>>> 1. You should not request 0 bytes from g_malloc().
>>
>> I think this was related to qemu_malloc() and Anthony's sed run made it
>> refer to g_malloc(), even though it works just fine with 0 bytes. We
>> should probably remove this sentence.
> 
> If you remove it then you can't interpret it the way I did.  It's not
> longer possible to say that g_malloc() never returns NULL.  You always
> have to qualify that with "unless you ask for 0 bytes". :)

Try this: "g_malloc() never returns an error". ;-)

Kevin

  parent reply	other threads:[~2011-12-15 10:41 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-15  8:10 [Qemu-devel] some questions about g_malloc in qemu Zhi Hui Li
2011-12-15  8:14 ` 陳韋任
2011-12-15  8:19 ` Andreas Färber
2011-12-15  8:28 ` 陳韋任
2011-12-15  9:36   ` Stefan Hajnoczi
2011-12-15  9:48     ` Zhi Hui Li
2011-12-15  9:56       ` 陳韋任
2011-12-15 10:02     ` Kevin Wolf
2011-12-15 10:19       ` Stefan Hajnoczi
2011-12-15 10:37         ` Max Filippov
2011-12-15 10:44         ` Kevin Wolf [this message]
2011-12-15 10:45         ` Peter Maydell

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=4EE9CF91.80701@redhat.com \
    --to=kwolf@redhat.com \
    --cc=chenwj@iis.sinica.edu.tw \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    --cc=stefanha@linux.vnet.ibm.com \
    --cc=zhihuili@cn.ibm.com \
    --cc=zhihuili@linux.vnet.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).