From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NplYv-0001ct-PZ for qemu-devel@nongnu.org; Thu, 11 Mar 2010 11:48:42 -0500 Received: from [199.232.76.173] (port=55685 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NplYt-0001aZ-5z for qemu-devel@nongnu.org; Thu, 11 Mar 2010 11:48:39 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NplYs-00034G-Ml for qemu-devel@nongnu.org; Thu, 11 Mar 2010 11:48:38 -0500 Received: from mx20.gnu.org ([199.232.41.8]:39759) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NplYr-00033t-VD for qemu-devel@nongnu.org; Thu, 11 Mar 2010 11:48:38 -0500 Received: from mail.codesourcery.com ([38.113.113.100]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NplOd-0007Iu-3R for qemu-devel@nongnu.org; Thu, 11 Mar 2010 11:38:03 -0500 From: Paul Brook Subject: Re: [Qemu-devel] [PATCH 04/17] virtio-9p: Implement P9_TSTAT Date: Thu, 11 Mar 2010 16:37:53 +0000 References: <1267642874-15001-1-git-send-email-aliguori@us.ibm.com> <201003091230.08628.paul@codesourcery.com> <4B96706F.9010901@linux.vnet.ibm.com> In-Reply-To: <4B96706F.9010901@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201003111637.53391.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: Anthony Liguori , jvrao , "Aneesh Kumar K. V" , Gautham R Shenoy > 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? Something like that, yes. Any use of [v]asprintf is incorrect. Paul