x86: Use g_new() & friends where that makes obvious sense
commitab3ad07f89c7f9e03c17c98e1d1a02dbf61c605c
authorMarkus Armbruster <armbru@redhat.com>
Thu, 4 Dec 2014 13:46:45 +0000 (4 14:46 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 15 Dec 2014 11:21:02 +0000 (15 12:21 +0100)
tree13eeaac95f3437959d8e861ff4207a0db70264af
parent4be34d1e2140b6d1be611c4bfa542c54c232520b
x86: Use g_new() & friends where that makes obvious sense

g_new(T, n) is neater than g_malloc(sizeof(T) * n).  It's also safer,
for two reasons.  One, it catches multiplication overflowing size_t.
Two, it returns T * rather than void *, which lets the compiler catch
more type errors.

This commit only touches allocations with size arguments of the form
sizeof(T).

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
hw/i386/pc.c
target-i386/kvm.c