use the replacement g_malloc/g_malloc0/g_realloc/g_free or
qemu_vmalloc/qemu_memalign/qemu_vfree APIs.
-Please note that NULL check for the qemu_malloc result is redundant and
+Please note that NULL check for the g_malloc result is redundant and
that g_malloc() call with zero size is not allowed.
Memory allocated by qemu_vmalloc or qemu_memalign must be freed with
if (!co) {
co = g_malloc0(sizeof(*co));
co->runnable = true;
- g_static_private_set(&coroutine_key, co, (GDestroyNotify)qemu_free);
+ g_static_private_set(&coroutine_key, co, (GDestroyNotify)g_free);
}
return &co->base;
static void cocoa_cleanup(void)
{
COCOA_DEBUG("qemu_cocoa: cocoa_cleanup\n");
- qemu_free(dcl);
+ g_free(dcl);
}
void cocoa_display_init(DisplayState *ds, int full_screen)
{
COCOA_DEBUG("qemu_cocoa: cocoa_display_init\n");
- dcl = qemu_mallocz(sizeof(DisplayChangeListener));
-
+ dcl = g_malloc0(sizeof(DisplayChangeListener));
+
// register vga output callbacks
dcl->dpy_update = cocoa_update;
dcl->dpy_resize = cocoa_resize;