From: Peter Maydell <peter.maydell@linaro.org>
To: Stefan Weil <sw@weilnetz.de>
Cc: "Peter A. G. Crosthwaite" <peter.crosthwaite@petalogix.com>,
qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/3] irq: Add new function qemu_init_irqs
Date: Mon, 24 Sep 2012 20:26:38 +0100 [thread overview]
Message-ID: <CAFEAcA_q68yu7vsiSfpOOoxVXQCSDFeQrN9n5JxC1mDNLM5Ugw@mail.gmail.com> (raw)
In-Reply-To: <1348513730-7485-2-git-send-email-sw@weilnetz.de>
On 24 September 2012 20:08, Stefan Weil <sw@weilnetz.de> wrote:
> It is used to avoid dynamic memory allocation for qemu_irq arrays
> with known size or single qemu_irq variables.
This patch is going to collide with Peter Crosthwaite's patch
that allows an irq array to be extended.
Also, the memory allocated with qemu_allocate_irqs() can be
freed with qemu_free_irqs(), but you don't seem to have
provided any way for direct callers of qemu_init_irqs()
to free the allocated IRQState array.
It feels to me like it ought to be possible to avoid having
random free-floating qemu_irq arrays at all : they should
all belong to devices which have (in theory) an opportunity
to free them in a deinit function. Explicit copying of qemu_irqs
out of one array and into other places, in particular, suggests
that maybe the code should be using qdev_get_gpio_in and
qdev_connect_gpio_out instead.
-- PMM
next prev parent reply other threads:[~2012-09-24 19:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-24 19:08 [Qemu-devel] [PATCH 0/3] Fix some memory leaks caused by qemu_allocate_irqs Stefan Weil
2012-09-24 19:08 ` [Qemu-devel] [PATCH 1/3] irq: Add new function qemu_init_irqs Stefan Weil
2012-09-24 19:26 ` Peter Maydell [this message]
2012-09-24 19:08 ` [Qemu-devel] [PATCH 2/3] hw/arm_timer: Fix memory leak (detected by Valgrind) Stefan Weil
2012-09-24 19:08 ` [Qemu-devel] [PATCH 3/3] hw/spitz: Fix memory leaks " Stefan Weil
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=CAFEAcA_q68yu7vsiSfpOOoxVXQCSDFeQrN9n5JxC1mDNLM5Ugw@mail.gmail.com \
--to=peter.maydell@linaro.org \
--cc=peter.crosthwaite@petalogix.com \
--cc=qemu-devel@nongnu.org \
--cc=sw@weilnetz.de \
/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).