From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MA0yO-0005zg-44 for qemu-devel@nongnu.org; Fri, 29 May 2009 08:14:08 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MA0yJ-0005xb-04 for qemu-devel@nongnu.org; Fri, 29 May 2009 08:14:07 -0400 Received: from [199.232.76.173] (port=35177 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MA0yI-0005xY-Ry for qemu-devel@nongnu.org; Fri, 29 May 2009 08:14:02 -0400 Received: from srv-05.w4a.fr ([94.23.5.116]:32899 helo=mx1.w4a.fr) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MA0yI-0008Jf-I2 for qemu-devel@nongnu.org; Fri, 29 May 2009 08:14:02 -0400 Date: Fri, 29 May 2009 13:13:57 +0100 (GMT+01:00) From: jcd@tribudubois.net Message-ID: <27806616.69111243599236983.JavaMail.root@srv-05.w4a.fr> In-Reply-To: <4A1FCF76.9070609@redhat.com> Subject: Re: [Qemu-devel] [PATCH] use qemu_malloc and friends consistently MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org ----- "Kevin Wolf" a =C3=A9crit : > > So it seems to me you definitively need a way to dicriminate between > the value returned on succesfull malloc(0) and the value returned on a > failed malloc(1000). >=20 > I should not have mentioned the malloc(0) in this mail, it only adds > to > the confusion. >=20 > What I wanted to say is that a failed qemu_malloc doesn't return > anything because it aborts (this code is in oom_check). So the caller > needs not and even cannot check for failure. OK, Sory, no failure case then ... My bad ... Then it is quite important to make sure qemu_malloc is used everywhere to c= atch/abort any allocation error with oom_check if we don't want/expect to l= et the user code deal with failure. JC >=20 > Kevin