Re: [Qemu-devel] [PATCH] qga: Use g_new() & friends where that makes obvious sense

2015-09-24 Thread Michael Roth
Quoting Markus Armbruster (2015-09-24 02:02:41) > Ping? Thanks, applied to qga tree: https://github.com/mdroth/qemu/commits/qga > > Markus Armbruster writes: > > > g_new(T, n) is neater than g_malloc(sizeof(T) * n). It's also safer, > > for two reasons. One, it catches multiplication over

Re: [Qemu-devel] [PATCH] qga: Use g_new() & friends where that makes obvious sense

2015-09-24 Thread Markus Armbruster
Ping? Markus Armbruster writes: > 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

Re: [Qemu-devel] [PATCH] qga: Use g_new() & friends where that makes obvious sense

2015-09-14 Thread Eric Blake
On 09/14/2015 05:50 AM, Markus Armbruster wrote: > 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 commi

[Qemu-devel] [PATCH] qga: Use g_new() & friends where that makes obvious sense

2015-09-14 Thread Markus Armbruster
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 si