[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/3] irq: Add new function qemu_init_irqs
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH 1/3] irq: Add new function qemu_init_irqs |
Date: |
Mon, 24 Sep 2012 20:26:38 +0100 |
On 24 September 2012 20:08, Stefan Weil <address@hidden> 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