From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NHaj0-00051C-Td for qemu-devel@nongnu.org; Mon, 07 Dec 2009 05:21:50 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NHaiv-0004z2-Oj for qemu-devel@nongnu.org; Mon, 07 Dec 2009 05:21:49 -0500 Received: from [199.232.76.173] (port=46628 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHaiv-0004yw-Dx for qemu-devel@nongnu.org; Mon, 07 Dec 2009 05:21:45 -0500 Received: from mx1.redhat.com ([209.132.183.28]:20633) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NHaiu-00052M-Uh for qemu-devel@nongnu.org; Mon, 07 Dec 2009 05:21:45 -0500 Message-ID: <4B1CD6DD.4020201@redhat.com> Date: Mon, 07 Dec 2009 11:20:13 +0100 From: Kevin Wolf MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] Permit zero-sized qemu_malloc() & friends References: <4B193DA5.6040507@codemonkey.ws> <4B1A9359.8080305@redhat.com> <4B1A9811.8020108@codemonkey.ws> <4B1BE153.6070509@collabora.co.uk> <4B1BE691.1010401@redhat.com> <4B1BF1A0.4030002@redhat.com> <4B1BF5B9.50608@redhat.com> <4B1CCF32.3060507@redhat.com> In-Reply-To: <4B1CCF32.3060507@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: Ian Molton , Paul Brook , Markus Armbruster , qemu-devel@nongnu.org Am 07.12.2009 10:47, schrieb Avi Kivity: > On 12/06/2009 08:41 PM, malc wrote: >> Sure. My point is that sometimes failure to allocate is due to bugs, >> invalid input etc, and conversion to OOM aborts en masse, might have >> not been the best possible route to take, but most likely it was better >> than doing nothing. >> > > I agree. Early oom handling does limit opportunities for recovery in > the cases where it is possible/easy. We can have an alternative API > that doesn't do oom handling for those cases where it is desirable. You could simply use normal malloc as an alternative API there. After all, the only thing that qemu_malloc adds is the OOM check (and currently also the zero check). Kevin