diff options
author | Anthony Liguori | 2011-08-21 05:09:37 +0200 |
---|---|---|
committer | Anthony Liguori | 2011-08-21 06:01:08 +0200 |
commit | 7267c0947d7e8ae5dff7bafd932c3bc285f43e5c (patch) | |
tree | 9aa05d6e05ed83e67bf014f6745a3081b8407dc5 /hw/irq.c | |
parent | Make glib mandatory and fixup utils appropriately (diff) | |
download | qemu-7267c0947d7e8ae5dff7bafd932c3bc285f43e5c.tar.gz qemu-7267c0947d7e8ae5dff7bafd932c3bc285f43e5c.tar.xz qemu-7267c0947d7e8ae5dff7bafd932c3bc285f43e5c.zip |
Use glib memory allocation and free functions
qemu_malloc/qemu_free no longer exist after this commit.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/irq.c')
-rw-r--r-- | hw/irq.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -44,8 +44,8 @@ qemu_irq *qemu_allocate_irqs(qemu_irq_handler handler, void *opaque, int n) struct IRQState *p; int i; - s = (qemu_irq *)qemu_mallocz(sizeof(qemu_irq) * n); - p = (struct IRQState *)qemu_mallocz(sizeof(struct IRQState) * n); + s = (qemu_irq *)g_malloc0(sizeof(qemu_irq) * n); + p = (struct IRQState *)g_malloc0(sizeof(struct IRQState) * n); for (i = 0; i < n; i++) { p->handler = handler; p->opaque = opaque; @@ -58,8 +58,8 @@ qemu_irq *qemu_allocate_irqs(qemu_irq_handler handler, void *opaque, int n) void qemu_free_irqs(qemu_irq *s) { - qemu_free(s[0]); - qemu_free(s); + g_free(s[0]); + g_free(s); } static void qemu_notirq(void *opaque, int line, int level) @@ -85,7 +85,7 @@ static void qemu_splitirq(void *opaque, int line, int level) qemu_irq qemu_irq_split(qemu_irq irq1, qemu_irq irq2) { - qemu_irq *s = qemu_mallocz(2 * sizeof(qemu_irq)); + qemu_irq *s = g_malloc0(2 * sizeof(qemu_irq)); s[0] = irq1; s[1] = irq2; return qemu_allocate_irqs(qemu_splitirq, s, 1)[0]; |