From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34567) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbnQv-0003vu-7o for qemu-devel@nongnu.org; Tue, 15 Sep 2015 06:25:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZbnQr-0000Ho-6B for qemu-devel@nongnu.org; Tue, 15 Sep 2015 06:25:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50922) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbnQq-0000HY-Ow for qemu-devel@nongnu.org; Tue, 15 Sep 2015 06:25:49 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 7A38B8EA27 for ; Tue, 15 Sep 2015 10:25:48 +0000 (UTC) Date: Tue, 15 Sep 2015 15:55:35 +0530 From: Amit Shah Message-ID: <20150915102535.GC10281@grmbl.mre> References: <1442231491-23352-1-git-send-email-armbru@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1442231491-23352-1-git-send-email-armbru@redhat.com> Subject: Re: [Qemu-devel] [PATCH] migration: Use g_new() & friends where that makes obvious sense List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: qemu-devel@nongnu.org, quintela@redhat.com On (Mon) 14 Sep 2015 [13:51:31], Markus Armbruster wrote: > g_new(T, n) is neater than g_malloc(sizeof(T) * n). It's also safer, > for two reasons. One, it catches multiplication overflowing size_t. > Two, it returns T * rather than void *, which lets the compiler catch > more type errors. > > This commit only touches allocations with size arguments of the form > sizeof(T). Same Coccinelle semantic patch as in commit b45c03f. > > Signed-off-by: Markus Armbruster Reviewed-by: Amit Shah Amit