mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
tests: use g_new() family of functions
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> [PMD: split of some files in other commits of the same series, add libqtest.c] Acked-by: John Snow <jsnow@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
This commit is contained in:
parent
d3c9218840
commit
790bbb9768
7 changed files with 11 additions and 11 deletions
|
@ -129,7 +129,7 @@ static MemBlock *mlist_new(uint64_t addr, uint64_t size)
|
|||
if (!size) {
|
||||
return NULL;
|
||||
}
|
||||
block = g_malloc0(sizeof(MemBlock));
|
||||
block = g_new0(MemBlock, 1);
|
||||
|
||||
block->addr = addr;
|
||||
block->size = size;
|
||||
|
@ -305,8 +305,8 @@ QGuestAllocator *alloc_init(uint64_t start, uint64_t end)
|
|||
s->start = start;
|
||||
s->end = end;
|
||||
|
||||
s->used = g_malloc(sizeof(MemList));
|
||||
s->free = g_malloc(sizeof(MemList));
|
||||
s->used = g_new(MemList, 1);
|
||||
s->free = g_new(MemList, 1);
|
||||
QTAILQ_INIT(s->used);
|
||||
QTAILQ_INIT(s->free);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue