From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NGvPS-0003ns-Gc for qemu-devel@nongnu.org; Sat, 05 Dec 2009 09:14:54 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NGvPL-0003lp-CX for qemu-devel@nongnu.org; Sat, 05 Dec 2009 09:14:52 -0500 Received: from [199.232.76.173] (port=59886 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NGvPK-0003lH-P6 for qemu-devel@nongnu.org; Sat, 05 Dec 2009 09:14:47 -0500 Received: from mail-pw0-f43.google.com ([209.85.160.43]:43415) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NGvPK-0002eh-C5 for qemu-devel@nongnu.org; Sat, 05 Dec 2009 09:14:46 -0500 Received: by pwi12 with SMTP id 12so2887290pwi.2 for ; Sat, 05 Dec 2009 06:14:45 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: <4B193DA5.6040507@codemonkey.ws> Date: Sat, 5 Dec 2009 15:14:45 +0100 Message-ID: <761ea48b0912050614n452c36e4nae2ffed0a878e0db@mail.gmail.com> Subject: Re: [Qemu-devel] [PATCH] Permit zero-sized qemu_malloc() & friends From: Laurent Desnogues Content-Type: text/plain; charset=ISO-8859-1 List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hello, probably a stupid remark, but I'll do it anyway :-) Let's assume there are some contexts where doing a memory allocation with a size of 0 is invalid while in some other contexts it is valid. Wouldn't it make sense in that case to have two functions that do memory allocation? Of course such a split would require full review of existing code and might introduce complexities for instance for realloc (was the original memory block allocated with a possible size of 0 or not?). Laurent