[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] rocker: Use g_new() & friends where that makes
From: |
Jiri Pirko |
Subject: |
Re: [Qemu-devel] [PATCH] rocker: Use g_new() & friends where that makes obvious sense |
Date: |
Mon, 14 Sep 2015 13:57:36 +0200 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
Mon, Sep 14, 2015 at 01:52:23PM CEST, address@hidden 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 commit only touches allocations with size arguments of the form
>sizeof(T). Same Coccinelle semantic patchas in commit b45c03f.
^ typo :)
Other than that:
Acked-by: Jiri Pirko <address@hidden>