qemu-malloc.c: Remove qemu-specific heap routines.
Remove all uses of qemu_malloc/malloc0/realloc/free/strdup/etc to use
the equivalent GLib functions (g_malloc, g_free, ...) as per upstream.
This also removes qemu-malloc.c since it's no longer required.
Change-Id: I3c36a0396b73dd114b8da385b43f56a2e54dbb15
diff --git a/qemu-timer.c b/qemu-timer.c
index d06b65b..25127e8 100644
--- a/qemu-timer.c
+++ b/qemu-timer.c
@@ -378,7 +378,7 @@
exit(0);
}
- arg = qemu_strdup(opt);
+ arg = g_strdup(opt);
/* Reorder the array */
name = strtok(arg, ",");
@@ -407,7 +407,7 @@
name = strtok(NULL, ",");
}
- qemu_free(arg);
+ g_free(arg);
if (cur) {
/* Disable remaining timers */
@@ -430,7 +430,7 @@
static QEMUClock *qemu_new_clock(int type)
{
QEMUClock *clock;
- clock = qemu_mallocz(sizeof(QEMUClock));
+ clock = g_malloc0(sizeof(QEMUClock));
clock->type = type;
clock->enabled = 1;
return clock;
@@ -530,7 +530,7 @@
{
QEMUTimer *ts;
- ts = qemu_mallocz(sizeof(QEMUTimer));
+ ts = g_malloc0(sizeof(QEMUTimer));
ts->clock = clock;
ts->cb = cb;
ts->opaque = opaque;
@@ -540,7 +540,7 @@
void qemu_free_timer(QEMUTimer *ts)
{
- qemu_free(ts);
+ g_free(ts);
}
/* stop a timer, but do not dealloc it */