Skip to content

Commit

Permalink
Convert last qemu_free and qemu_malloc uses
Browse files Browse the repository at this point in the history
7267c09 missed
a few cases, fix them.

Signed-off-by: Blue Swirl <[email protected]>
  • Loading branch information
blueswirl committed Aug 21, 2011
1 parent c76c841 commit 58a0667
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion HACKING
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ APIs is not allowed in the QEMU codebase. Instead of these routines,
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
Expand Down
2 changes: 1 addition & 1 deletion coroutine-gthread.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ Coroutine *qemu_coroutine_self(void)
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;
Expand Down
6 changes: 3 additions & 3 deletions ui/cocoa.m
Original file line number Diff line number Diff line change
Expand Up @@ -1004,15 +1004,15 @@ static void cocoa_refresh(DisplayState *ds)
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;
Expand Down

0 comments on commit 58a0667

Please sign in to comment.