From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Np1qY-0003Z7-DL for qemu-devel@nongnu.org; Tue, 09 Mar 2010 10:59:50 -0500 Received: from [199.232.76.173] (port=49735 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Np1qY-0003Ye-0y for qemu-devel@nongnu.org; Tue, 09 Mar 2010 10:59:50 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Np1qX-0005y3-6F for qemu-devel@nongnu.org; Tue, 09 Mar 2010 10:59:49 -0500 Received: from e9.ny.us.ibm.com ([32.97.182.139]:46561) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Np1qW-0005xt-W4 for qemu-devel@nongnu.org; Tue, 09 Mar 2010 10:59:49 -0500 Received: from d01relay07.pok.ibm.com (d01relay07.pok.ibm.com [9.56.227.147]) by e9.ny.us.ibm.com (8.14.3/8.13.1) with ESMTP id o29FnQaX001795 for ; Tue, 9 Mar 2010 10:49:26 -0500 Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay07.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id o29Fxkf81867822 for ; Tue, 9 Mar 2010 10:59:46 -0500 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id o29FxjYX016979 for ; Tue, 9 Mar 2010 10:59:46 -0500 Message-ID: <4B96706F.9010901@linux.vnet.ibm.com> Date: Tue, 09 Mar 2010 07:59:43 -0800 From: jvrao MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 04/17] virtio-9p: Implement P9_TSTAT References: <1267642874-15001-1-git-send-email-aliguori@us.ibm.com> <87vddcjhpv.fsf@linux.vnet.ibm.com> <4B95AD93.1070502@linux.vnet.ibm.com> <201003091230.08628.paul@codesourcery.com> In-Reply-To: <201003091230.08628.paul@codesourcery.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: Paul Brook Cc: Anthony Liguori , Gautham R Shenoy , qemu-devel@nongnu.org, "Aneesh Kumar K. V" Paul Brook wrote: >> Is there any reason (other than being coding style) in using qemu_free() >> instead of free()? As per qem-malloc.c qemu_free() is nothing but free(). > > The whole point of qemu_{malloc,free} is to isolate code from the system > implementation of malloc/free. It's entirely possible that future versions of > qemu_malloc will use a different memory allocation strategy. > >> The reason I am asking is.. tracking string allocs become tricky >> if some of them were defined using qemu_alloc() and others are allocated >> through sprintf(). > > sprintf does not allocate memory. > If you mean strdup, then you shouldn't be using that (use qemu_strdup). Thanks for correcting Paul.. I was talking about vasprintf() .. not really the sprintf() In any case.. right way to do it may be adding a new qemu_vasprintf() for and use it along with qemu_free() Right? Thanks, JV > > Paul