From: Amit Shah <amit.shah@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org, quintela@redhat.com
Subject: Re: [Qemu-devel] [PATCH] migration: Use g_new() & friends where that makes obvious sense
Date: Tue, 15 Sep 2015 15:55:35 +0530 [thread overview]
Message-ID: <20150915102535.GC10281@grmbl.mre> (raw)
In-Reply-To: <1442231491-23352-1-git-send-email-armbru@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 <armbru@redhat.com>
Reviewed-by: Amit Shah <amit.shah@redhat.com>
Amit
prev parent reply other threads:[~2015-09-15 10:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-14 11:51 [Qemu-devel] [PATCH] migration: Use g_new() & friends where that makes obvious sense Markus Armbruster
2015-09-14 15:51 ` Eric Blake
2015-09-15 1:10 ` zhanghailiang
2015-09-15 10:25 ` Amit Shah [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150915102535.GC10281@grmbl.mre \
--to=amit.shah@redhat.com \
--cc=armbru@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).