From: malc <av1474@comtv.ru>
To: Alexander Graf <agraf@suse.de>
Cc: Avi Kivity <avi@redhat.com>, Blue Swirl <blauwirbel@gmail.com>,
Peter Maydell <peter.maydell@linaro.org>,
QEMU-devel Developers <qemu-devel@nongnu.org>,
"kvm@vger.kernel.org list" <kvm@vger.kernel.org>
Subject: Re: [Qemu-devel] [PATCH] Introduce QEMU_NEW()
Date: Mon, 25 Jul 2011 14:46:21 +0400 (MSD) [thread overview]
Message-ID: <alpine.LNX.2.00.1107251445480.2322@linmac> (raw)
In-Reply-To: <BD86B8F2-5FFE-438E-B08D-DD9BA93A2A9E@suse.de>
On Mon, 25 Jul 2011, Alexander Graf wrote:
>
> On 25.07.2011, at 12:09, Avi Kivity wrote:
>
> > On 07/25/2011 01:04 PM, Alexander Graf wrote:
> >> On 25.07.2011, at 12:02, Avi Kivity wrote:
> >>
> >> > On 07/25/2011 12:56 PM, Alexander Graf wrote:
> >> >> >
> >> >> > That argument can be used to block any change. You'll get used to it in time. The question is, is the new interface better or not.
> >> >>
> >> >> I agree that it keeps you from accidently malloc'ing a struct of pointer size. But couldn't we also just add this to checkpatch.pl?
> >> >
> >> > Better APIs trump better patch review.
> >>
> >> Only if you enforce them. The only sensible thing for QEMU_NEW (despite the general rule of upper case macros, I'd actually prefer this one to be lower case though since it's so often used) would be to remove qemu_malloc, declare malloc() as unusable and convert all users of qemu_malloc() to qemu_new().
> >
> > Some qemu_mallocs() will remain (allocating a byte array or something variable sized).
>
> Right. But then we really do need a check in checkpatch.pl to see if someone's using qemu_new for simple structs.
>
> > I agree qemu_new() will be nicer, but that will have to wait until Blue is several light-days away from Earth.
>
> Blue, any disagreement on adding qemu_new() as a macro? Something used
> that often in upper case would seriously disturb the reading flow :)
So do not use it then, macros should be uppercase.
--
mailto:av1474@comtv.ru
next prev parent reply other threads:[~2011-07-25 10:46 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-25 8:51 [PATCH] Introduce QEMU_NEW() Avi Kivity
2011-07-25 9:32 ` Alexander Graf
2011-07-25 9:37 ` Sasha Levin
2011-07-25 9:43 ` Alexander Graf
2011-07-25 9:49 ` Avi Kivity
2011-07-25 9:48 ` [Qemu-devel] " Peter Maydell
2011-07-25 9:52 ` Avi Kivity
2011-07-25 9:56 ` Alexander Graf
2011-07-25 10:02 ` Avi Kivity
2011-07-25 10:04 ` [Qemu-devel] " Alexander Graf
2011-07-25 10:09 ` Avi Kivity
2011-07-25 10:19 ` Alexander Graf
2011-07-25 10:46 ` malc [this message]
2011-07-25 10:59 ` Markus Armbruster
2011-07-25 11:11 ` [Qemu-devel] " Alexander Graf
2011-07-25 12:19 ` Anthony Liguori
2011-07-25 14:16 ` Blue Swirl
2011-07-25 14:20 ` Avi Kivity
2011-07-25 12:30 ` [Qemu-devel] " Anthony Liguori
2011-07-25 11:35 ` Avi Kivity
2011-07-25 10:06 ` Stefan Hajnoczi
2011-07-25 10:12 ` [Qemu-devel] " Avi Kivity
2011-07-25 10:25 ` Kevin Wolf
2011-07-25 10:28 ` Stefan Hajnoczi
2011-07-25 11:02 ` Markus Armbruster
2011-07-25 11:45 ` Avi Kivity
2011-07-25 15:10 ` Jes Sorensen
2011-07-25 15:15 ` [Qemu-devel] " Anthony Liguori
2011-07-25 15:17 ` Jes Sorensen
2011-07-25 15:20 ` Avi Kivity
2011-07-25 15:21 ` [Qemu-devel] " Jes Sorensen
2011-07-25 15:24 ` Avi Kivity
2011-07-25 15:28 ` [Qemu-devel] " Jes Sorensen
2011-07-25 15:35 ` Avi Kivity
2011-07-25 12:11 ` Anthony Liguori
2011-07-25 12:18 ` [Qemu-devel] " Avi Kivity
2011-07-25 12:21 ` Anthony Liguori
2011-07-25 12:41 ` Avi Kivity
2011-07-25 14:23 ` [Qemu-devel] " Blue Swirl
2011-07-25 14:25 ` Anthony Liguori
2011-07-25 14:30 ` Max Filippov
2011-07-25 14:43 ` [Qemu-devel] " Anthony Liguori
2011-07-25 14:47 ` malc
2011-07-25 14:50 ` [Qemu-devel] " Avi Kivity
2011-07-25 14:58 ` malc
2011-07-25 14:59 ` Avi Kivity
2011-07-25 14:51 ` Paolo Bonzini
2011-07-25 14:56 ` Blue Swirl
2011-07-25 15:21 ` Paolo Bonzini
2011-08-01 10:49 ` Richard W.M. Jones
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=alpine.LNX.2.00.1107251445480.2322@linmac \
--to=av1474@comtv.ru \
--cc=agraf@suse.de \
--cc=avi@redhat.com \
--cc=blauwirbel@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/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