From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NFSIb-0006wH-QQ for qemu-devel@nongnu.org; Tue, 01 Dec 2009 07:57:45 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NFSIW-0006vD-82 for qemu-devel@nongnu.org; Tue, 01 Dec 2009 07:57:44 -0500 Received: from [199.232.76.173] (port=50935 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NFSIW-0006v5-0W for qemu-devel@nongnu.org; Tue, 01 Dec 2009 07:57:40 -0500 Received: from mx20.gnu.org ([199.232.41.8]:46539) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NFSIV-0005GY-RR for qemu-devel@nongnu.org; Tue, 01 Dec 2009 07:57:39 -0500 Received: from mail.codesourcery.com ([38.113.113.100]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NFSIR-0004El-Rc for qemu-devel@nongnu.org; Tue, 01 Dec 2009 07:57:36 -0500 From: Paul Brook Subject: Re: [Qemu-devel] [PATCH] Permit zero-sized qemu_malloc() & friends Date: Tue, 1 Dec 2009 12:57:27 +0000 References: <4B150EAD.4050502@redhat.com> In-Reply-To: <4B150EAD.4050502@redhat.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200912011257.28121.paul@codesourcery.com> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , Markus Armbruster > You might want to have a 'static uint8_t zero_length_malloc[0]' and > return that instead of the magic cookie '1'. Makes the code more > readable IMHO and you'll also have symbol in gdb when debugging qemu. Having multiple malloc return the same pointer sounds like a really bad idea. Paul