From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M6W1G-0001ci-MO for qemu-devel@nongnu.org; Tue, 19 May 2009 16:34:38 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M6W1B-0001Un-Pe for qemu-devel@nongnu.org; Tue, 19 May 2009 16:34:37 -0400 Received: from [199.232.76.173] (port=34658 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M6W1B-0001UM-K2 for qemu-devel@nongnu.org; Tue, 19 May 2009 16:34:33 -0400 Received: from mail2.shareable.org ([80.68.89.115]:45463) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1M6W1B-0005OW-2q for qemu-devel@nongnu.org; Tue, 19 May 2009 16:34:33 -0400 Date: Tue, 19 May 2009 21:34:27 +0100 From: Jamie Lokier Subject: Re: [PATCH] Make qemu_alloc()/qemu_realloc() return NULL for size==0 (was Re: [Qemu-devel] [PATCH] fix qemu_malloc() error check for size==0) Message-ID: <20090519203427.GD3986@shareable.org> References: <20090518221705.GO2079@blackpad> <8763fxvbfk.fsf@pike.pond.sub.org> <20090519140201.GB4254@blackpad> <20090519144424.GD4254@blackpad> <20090519164440.GH4254@blackpad> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: malc Cc: qemu-devel@nongnu.org, Eduardo Habkost , Markus Armbruster malc wrote: > Thanks for an attempt, but i don't like it either, since it sortof > breaks the (unspoken?) qemu_malloc/realloc contract that those will > never return NULL. I've commited the thing i had in mind. realloc returns NULL if the size is zero, and frees the object if the pointer is non-NULL. -- Jamie