]> git.proxmox.com Git - mirror_qemu.git/blobdiff - cpus-common.c
Use g_new() & friends where that makes obvious sense
[mirror_qemu.git] / cpus-common.c
index 6e73d3e58dac6b6f4e117d56f5020d8496f17439..db459b41ce20ac0ff2f69b8acabdb3816a97c6ad 100644 (file)
@@ -160,7 +160,7 @@ void async_run_on_cpu(CPUState *cpu, run_on_cpu_func func, run_on_cpu_data data)
 {
     struct qemu_work_item *wi;
 
-    wi = g_malloc0(sizeof(struct qemu_work_item));
+    wi = g_new0(struct qemu_work_item, 1);
     wi->func = func;
     wi->data = data;
     wi->free = true;
@@ -305,7 +305,7 @@ void async_safe_run_on_cpu(CPUState *cpu, run_on_cpu_func func,
 {
     struct qemu_work_item *wi;
 
-    wi = g_malloc0(sizeof(struct qemu_work_item));
+    wi = g_new0(struct qemu_work_item, 1);
     wi->func = func;
     wi->data = data;
     wi->free = true;