Re: [PATCH 2/2] util/compatfd.c: Replaced a malloc call with g_malloc.

2021-03-15 Thread Philippe Mathieu-Daudé
On 3/15/21 3:53 PM, Thomas Huth wrote: > On 15/03/2021 15.25, Markus Armbruster wrote: >> Mahmoud, it's generally a good idea to cc: people who commented on a >> previous iteration of the same patch.  In this case, Thomas.  I'm doing >> that for you now. >> >> Mahmoud Mandour writes: >> >>> On Mon

Re: [PATCH 2/2] util/compatfd.c: Replaced a malloc call with g_malloc.

2021-03-15 Thread Thomas Huth
On 15/03/2021 15.25, Markus Armbruster wrote: Mahmoud, it's generally a good idea to cc: people who commented on a previous iteration of the same patch. In this case, Thomas. I'm doing that for you now. Mahmoud Mandour writes: On Mon, Mar 15, 2021 at 1:13 PM Philippe Mathieu-Daudé wrote:

Re: [PATCH 2/2] util/compatfd.c: Replaced a malloc call with g_malloc.

2021-03-15 Thread Markus Armbruster
Mahmoud, it's generally a good idea to cc: people who commented on a previous iteration of the same patch. In this case, Thomas. I'm doing that for you now. Mahmoud Mandour writes: > On Mon, Mar 15, 2021 at 1:13 PM Philippe Mathieu-Daudé > wrote: > >> Hi Mahmoud, >> >> On 3/15/21 11:58 AM, Ma

Re: [PATCH 2/2] util/compatfd.c: Replaced a malloc call with g_malloc.

2021-03-15 Thread Mahmoud Mandour
On Mon, Mar 15, 2021 at 1:13 PM Philippe Mathieu-Daudé wrote: > Hi Mahmoud, > > On 3/15/21 11:58 AM, Mahmoud Mandour wrote: > > Replaced a call to malloc() and its respective call to free() > > with g_malloc() and g_free(). > > > > g_malloc() is preferred more than g_try_* functions, which > > re

Re: [PATCH 2/2] util/compatfd.c: Replaced a malloc call with g_malloc.

2021-03-15 Thread Philippe Mathieu-Daudé
Hi Mahmoud, On 3/15/21 11:58 AM, Mahmoud Mandour wrote: > Replaced a call to malloc() and its respective call to free() > with g_malloc() and g_free(). > > g_malloc() is preferred more than g_try_* functions, which > return NULL on error, when the size of the requested > allocation is small. Thi

[PATCH 2/2] util/compatfd.c: Replaced a malloc call with g_malloc.

2021-03-15 Thread Mahmoud Mandour
Replaced a call to malloc() and its respective call to free() with g_malloc() and g_free(). g_malloc() is preferred more than g_try_* functions, which return NULL on error, when the size of the requested allocation is small. This is because allocating few bytes should not be a problem in a health