summaryrefslogtreecommitdiff
path: root/qlist.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-08-20 22:09:37 -0500
committerAnthony Liguori <aliguori@us.ibm.com>2011-08-20 23:01:08 -0500
commit52e431959c8a063b4d79db47e9bdcc5a8f1d21f1 (patch)
tree9aa05d6e05ed83e67bf014f6745a3081b8407dc5 /qlist.c
parent2be0e4ec99e6f88c4c48a14bdb5dd1f6413e4073 (diff)
downloadqemu-52e431959c8a063b4d79db47e9bdcc5a8f1d21f1.tar.gz
qemu-52e431959c8a063b4d79db47e9bdcc5a8f1d21f1.tar.bz2
qemu-52e431959c8a063b4d79db47e9bdcc5a8f1d21f1.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 'qlist.c')
-rw-r--r--qlist.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/qlist.c b/qlist.c
index 5730fb87f7..88498b157f 100644
--- a/qlist.c
+++ b/qlist.c
@@ -31,7 +31,7 @@ QList *qlist_new(void)
{
QList *qlist;
- qlist = qemu_malloc(sizeof(*qlist));
+ qlist = g_malloc(sizeof(*qlist));
QTAILQ_INIT(&qlist->head);
QOBJECT_INIT(qlist, &qlist_type);
@@ -64,7 +64,7 @@ void qlist_append_obj(QList *qlist, QObject *value)
{
QListEntry *entry;
- entry = qemu_malloc(sizeof(*entry));
+ entry = g_malloc(sizeof(*entry));
entry->value = value;
QTAILQ_INSERT_TAIL(&qlist->head, entry, next);
@@ -98,7 +98,7 @@ QObject *qlist_pop(QList *qlist)
QTAILQ_REMOVE(&qlist->head, entry, next);
ret = entry->value;
- qemu_free(entry);
+ g_free(entry);
return ret;
}
@@ -150,8 +150,8 @@ static void qlist_destroy_obj(QObject *obj)
QTAILQ_FOREACH_SAFE(entry, &qlist->head, next, next_entry) {
QTAILQ_REMOVE(&qlist->head, entry, next);
qobject_decref(entry->value);
- qemu_free(entry);
+ g_free(entry);
}
- qemu_free(qlist);
+ g_free(qlist);
}