[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] linux-user: Use g_new() & friends where that ma
From: |
Stefan Weil |
Subject: |
Re: [Qemu-devel] [PATCH] linux-user: Use g_new() & friends where that makes obvious sense |
Date: |
Thu, 24 Sep 2015 09:18:12 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.8.0 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Am 24.09.2015 um 09:06 schrieb Markus Armbruster:
> Ping?
>
> Markus Armbruster <address@hidden> 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 allocations with size arguments of the
>> form sizeof(T). Same Coccinelle semantic patchas in commit
>> b45c03f.
>>
>> Signed-off-by: Markus Armbruster <address@hidden> ---
>> linux-user/elfload.c | 2 +- linux-user/main.c | 2 +-
>> linux-user/syscall.c | 2 +- 3 files changed, 3 insertions(+), 3
>> deletions(-)
Reviewed-by: Stefan Weil <address@hidden>
This patch is trivial enough for qemu-trivial.
As Eric has written, the commit message needs
a small correction: s/patchas/patch as/
Regards
Stefan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQIcBAEBCAAGBQJWA6OuAAoJEOCMIdVndFCt6Q8P/R6kKihtOvr17lL3Av117n1z
YPv6Tfa9jy1fd3qaeIMhXgm63CNTWTGU4o0A9/k3thqiD9kYVpqeZkd7gt1gE6uU
QR/eReEMZNr+5AnkYnCmZ8wr5upd4RWUjCvbGSUpFgb1ui+VtwZ08XzCVehQfY39
2S6EWxR/I7ETxzue+AFZak9w4QqVF7IQmw7CPkeTCD/himdCpyeGxL9dYQnyfEdW
mQeXUR2eipaqwIt1b6JkwQCU78rY2D/OLVDipZK9M4BSmJQWS2BsLboc+VC59bN9
JkVrKgSbuciqBMXDudY71qv9XO/wyM8MwnDM5GY7V9N1PoRVcg2mvSCRKq9lP82K
V0Sb6n1j9/AgM3ngnLZqkiVYkeFrnccIkiKCJvmDnDP1ClC8Cy5V1wkPzk7TJgTK
4xvuI3kfWPIzbphWzZtcCstJKYaO5ydrEGGNGko37A6s65oE+gIhyrv/KSIhix+H
n7KMOILY4wuk7UYoIgK6cvKL6QsVyhw0lR+RIR8p33ofAj20HylQng38h6spr50F
XTl3J38ApbyxNhw+EJHXXwj14YJFrZTwN8C0X49UHkSD4wqR4lH+2kdNUYIYJJHR
Zx+HkJj/8hLQq14WjtgZlNQ7noAck/yh9Rvyu54v6yfx1RAhNkDbiysQKgqkWzNM
U5ro2khoY2BrI7Bdq29H
=/Z+4
-----END PGP SIGNATURE-----