diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2011-08-20 22:09:37 -0500 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2011-08-20 23:01:08 -0500 |
commit | 7267c0947d7e8ae5dff7bafd932c3bc285f43e5c (patch) | |
tree | 9aa05d6e05ed83e67bf014f6745a3081b8407dc5 /block/qcow2-cache.c | |
parent | 14015304b662e8f8ccce46c5a6927af6a14c510b (diff) | |
download | qemu-7267c0947d7e8ae5dff7bafd932c3bc285f43e5c.tar.gz qemu-7267c0947d7e8ae5dff7bafd932c3bc285f43e5c.tar.bz2 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 'block/qcow2-cache.c')
-rw-r--r-- | block/qcow2-cache.c | 8 |
1 files changed, 4 insertions, 4 deletions
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; } |