From 7267c0947d7e8ae5dff7bafd932c3bc285f43e5c Mon Sep 17 00:00:00 2001 From: Anthony Liguori Date: Sat, 20 Aug 2011 22:09:37 -0500 Subject: Use glib memory allocation and free functions qemu_malloc/qemu_free no longer exist after this commit. Signed-off-by: Anthony Liguori --- block/qcow2-cache.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'block/qcow2-cache.c') diff --git a/block/qcow2-cache.c b/block/qcow2-cache.c index 84088477a4..340a6f2b26 100644 --- a/block/qcow2-cache.c +++ b/block/qcow2-cache.c @@ -49,9 +49,9 @@ Qcow2Cache *qcow2_cache_create(BlockDriverState *bs, int num_tables, Qcow2Cache *c; int i; - c = qemu_mallocz(sizeof(*c)); + c = g_malloc0(sizeof(*c)); c->size = num_tables; - c->entries = qemu_mallocz(sizeof(*c->entries) * num_tables); + c->entries = g_malloc0(sizeof(*c->entries) * num_tables); c->writethrough = writethrough; for (i = 0; i < c->size; i++) { @@ -70,8 +70,8 @@ int qcow2_cache_destroy(BlockDriverState* bs, Qcow2Cache *c) qemu_vfree(c->entries[i].table); } - qemu_free(c->entries); - qemu_free(c); + g_free(c->entries); + g_free(c); return 0; } -- cgit v1.2.3