aboutsummaryrefslogtreecommitdiff
path: root/qstring.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
commit7267c0947d7e8ae5dff7bafd932c3bc285f43e5c (patch)
tree9aa05d6e05ed83e67bf014f6745a3081b8407dc5 /qstring.c
parent14015304b662e8f8ccce46c5a6927af6a14c510b (diff)
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 'qstring.c')
-rw-r--r--qstring.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/qstring.c b/qstring.c
index 4e2ba083b7..b7e12e4015 100644
--- a/qstring.c
+++ b/qstring.c
@@ -40,12 +40,12 @@ QString *qstring_from_substr(const char *str, int start, int end)
{
QString *qstring;
- qstring = qemu_malloc(sizeof(*qstring));
+ qstring = g_malloc(sizeof(*qstring));
qstring->length = end - start + 1;
qstring->capacity = qstring->length;
- qstring->string = qemu_malloc(qstring->capacity + 1);
+ qstring->string = g_malloc(qstring->capacity + 1);
memcpy(qstring->string, str + start, qstring->length);
qstring->string[qstring->length] = 0;
@@ -70,7 +70,7 @@ static void capacity_increase(QString *qstring, size_t len)
qstring->capacity += len;
qstring->capacity *= 2; /* use exponential growth */
- qstring->string = qemu_realloc(qstring->string, qstring->capacity + 1);
+ qstring->string = g_realloc(qstring->string, qstring->capacity + 1);
}
}
@@ -136,6 +136,6 @@ static void qstring_destroy_obj(QObject *obj)
assert(obj != NULL);
qs = qobject_to_qstring(obj);
- qemu_free(qs->string);
- qemu_free(qs);
+ g_free(qs->string);
+ g_free(qs);
}