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 /cutils.c | |
parent | Make glib mandatory and fixup utils appropriately (diff) | |
download | qemu-kvm-7267c0947d7e8ae5dff7bafd932c3bc285f43e5c.tar.gz qemu-kvm-7267c0947d7e8ae5dff7bafd932c3bc285f43e5c.tar.bz2 qemu-kvm-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 'cutils.c')
-rw-r--r-- | cutils.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -136,7 +136,7 @@ int qemu_fdatasync(int fd) void qemu_iovec_init(QEMUIOVector *qiov, int alloc_hint) { - qiov->iov = qemu_malloc(alloc_hint * sizeof(struct iovec)); + qiov->iov = g_malloc(alloc_hint * sizeof(struct iovec)); qiov->niov = 0; qiov->nalloc = alloc_hint; qiov->size = 0; @@ -160,7 +160,7 @@ void qemu_iovec_add(QEMUIOVector *qiov, void *base, size_t len) if (qiov->niov == qiov->nalloc) { qiov->nalloc = 2 * qiov->nalloc + 1; - qiov->iov = qemu_realloc(qiov->iov, qiov->nalloc * sizeof(struct iovec)); + qiov->iov = g_realloc(qiov->iov, qiov->nalloc * sizeof(struct iovec)); } qiov->iov[qiov->niov].iov_base = base; qiov->iov[qiov->niov].iov_len = len; @@ -217,7 +217,7 @@ void qemu_iovec_destroy(QEMUIOVector *qiov) { assert(qiov->nalloc != -1); - qemu_free(qiov->iov); + g_free(qiov->iov); } void qemu_iovec_reset(QEMUIOVector *qiov) |