mirror of
https://github.com/mii443/qemu.git
synced 2025-08-22 23:25:48 +00:00
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>
This commit is contained in:
10
qemu-timer.c
10
qemu-timer.c
@ -327,7 +327,7 @@ void configure_alarms(char const *opt)
|
||||
exit(0);
|
||||
}
|
||||
|
||||
arg = qemu_strdup(opt);
|
||||
arg = g_strdup(opt);
|
||||
|
||||
/* Reorder the array */
|
||||
name = strtok(arg, ",");
|
||||
@ -356,7 +356,7 @@ next:
|
||||
name = strtok(NULL, ",");
|
||||
}
|
||||
|
||||
qemu_free(arg);
|
||||
g_free(arg);
|
||||
|
||||
if (cur) {
|
||||
/* Disable remaining timers */
|
||||
@ -380,7 +380,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;
|
||||
notifier_list_init(&clock->reset_notifiers);
|
||||
@ -485,7 +485,7 @@ QEMUTimer *qemu_new_timer(QEMUClock *clock, int scale,
|
||||
{
|
||||
QEMUTimer *ts;
|
||||
|
||||
ts = qemu_mallocz(sizeof(QEMUTimer));
|
||||
ts = g_malloc0(sizeof(QEMUTimer));
|
||||
ts->clock = clock;
|
||||
ts->cb = cb;
|
||||
ts->opaque = opaque;
|
||||
@ -495,7 +495,7 @@ QEMUTimer *qemu_new_timer(QEMUClock *clock, int scale,
|
||||
|
||||
void qemu_free_timer(QEMUTimer *ts)
|
||||
{
|
||||
qemu_free(ts);
|
||||
g_free(ts);
|
||||
}
|
||||
|
||||
/* stop a timer, but do not dealloc it */
|
||||
|
Reference in New Issue
Block a user