Received: from eggs.gnu.org ([2001:4830:134:3::10]:42739) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zf9ES-0002oX-Dr for qemu-devel@nongnu.org; Thu, 24 Sep 2015 12:18:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zf9EN-0003QK-Gc for qemu-devel@nongnu.org; Thu, 24 Sep 2015 12:18:52 -0400 From: Markus Armbruster References: <1442231543-23446-1-git-send-email-armbru@redhat.com> Date: Thu, 24 Sep 2015 18:18:43 +0200 In-Reply-To: <1442231543-23446-1-git-send-email-armbru@redhat.com> (Markus Armbruster's message of "Mon, 14 Sep 2015 13:52:23 +0200") Message-ID: <87oagrbxjw.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH] rocker: Use g_new() & friends where that makes obvious sense List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, jiri@resnulli.us, sfeldma@gmail.com Michael, could you take this one through trivial? Assuming Scott and Jiri don't mind, and with s/patchas/patch as/ in the commit message. Markus Armbruster writes: > 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 patchas in commit b45c03f. > > Signed-off-by: Markus Armbruster