From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38272) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbWJB-0002kh-1g for qemu-devel@nongnu.org; Mon, 14 Sep 2015 12:08:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZbWJ7-0000ZT-Qg for qemu-devel@nongnu.org; Mon, 14 Sep 2015 12:08:44 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35250) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbWJ7-0000Y4-Ly for qemu-devel@nongnu.org; Mon, 14 Sep 2015 12:08:41 -0400 References: <1442231583-23535-1-git-send-email-armbru@redhat.com> <55F6ED1F.2040508@redhat.com> From: Eric Blake Message-ID: <55F6F107.2070301@redhat.com> Date: Mon, 14 Sep 2015 10:08:39 -0600 MIME-Version: 1.0 In-Reply-To: <55F6ED1F.2040508@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="84q9MGVBAaHpitwk9X34UtGth5qTwgiTs" Subject: Re: [Qemu-devel] [PATCH] linux-user: Use g_new() & friends where that makes obvious sense List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: riku.voipio@iki.fi This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --84q9MGVBAaHpitwk9X34UtGth5qTwgiTs Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/14/2015 09:51 AM, Eric Blake wrote: > On 09/14/2015 05:53 AM, 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 patchas in commit b45c03f. s/patchas/patch as/ >> >> Signed-off-by: Markus Armbruster >> --- >> linux-user/elfload.c | 2 +- >> linux-user/main.c | 2 +- >> linux-user/syscall.c | 2 +- >> 3 files changed, 3 insertions(+), 3 deletions(-) >=20 > Reviewed-by: Eric Blake >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --84q9MGVBAaHpitwk9X34UtGth5qTwgiTs Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJV9vEHAAoJEKeha0olJ0Nq59IH/0EFTb6wRxr8OjeH5h+mFXL2 Er9zFZVDDG7P56Fkux//sSRGa8wMOWKVaZqUF8bytekXtup88JTlG7PbjUkYIEjn OpFWhMgOj7EESjv2sIT3BzPkCJEDbPo6O+F8Ghm3qBjWBI5Mu64jIsQiJZ/aN/mb XWNYeT6gx6pBBlJvqDVXVThqq1WKuP33PJCIsSuAAkSEtyoxQzRmy1WKCG/FLYUy IkRpCq5xyUFYu9PyH2Uy7EroFp8/v2NSWXFK4/sD+lZnNoS2QGR0WQ35dsH6o8pk z/mlxyPG1sH9K0xjoyahe6eivwhD4yQK4h9Tf4vZu0Ln6QWAp+88GD7ZAj+wuAc= =L8sh -----END PGP SIGNATURE----- --84q9MGVBAaHpitwk9X34UtGth5qTwgiTs--