From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36877) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zk7tz-0003K1-DF for qemu-devel@nongnu.org; Thu, 08 Oct 2015 05:54:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zk7tn-00009C-W1 for qemu-devel@nongnu.org; Thu, 08 Oct 2015 05:54:19 -0400 Received: from mail-wi0-x22c.google.com ([2a00:1450:400c:c05::22c]:33653) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zk7tn-00008t-NS for qemu-devel@nongnu.org; Thu, 08 Oct 2015 05:54:07 -0400 Received: by wiclk2 with SMTP id lk2so20372098wic.0 for ; Thu, 08 Oct 2015 02:54:07 -0700 (PDT) Date: Thu, 8 Oct 2015 10:54:04 +0100 From: Stefan Hajnoczi Message-ID: <20151008095404.GE14090@stefanha-thinkpad.redhat.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH v6] linux-user/syscall.c: malloc()/calloc() to g_malloc()/g_try_malloc()/g_new0() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Harmandeep Kaur Cc: Peter Maydell , Riku Voipio , qemu-devel On Tue, Oct 06, 2015 at 09:47:12PM +0530, Harmandeep Kaur wrote: > Convert malloc()/ calloc() calls to g_malloc()/ g_try_malloc()/ g_new0() > > All heap memory allocation should go through glib so that we can take > advantage of a single memory allocator and its debugging/tracing features. > > Signed-off-by: Harmandeep Kaur > --- > v1->v2 convert the free() call in host_to_target_semarray() > to g_free() and calls g_try_malloc(count) instead of > g_try_malloc(sizeof(count)) > > v2->v3 used g_try_new() and friends to avoid overflow issues > > v3->v4 use g_free for unlock_iovec() and host_to_target_semarray(). > > v4->v5 one missing malloc() is converted and one converted is fixed. > > v5->v6 new improved commit description. > > --- > linux-user/syscall.c | 28 ++++++++++++++-------------- > 1 file changed, 14 insertions(+), 14 deletions(-) Reviewed-by: Stefan Hajnoczi