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 /qstring.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 'qstring.c')
-rw-r--r-- | qstring.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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); } |