qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 1/8] bsd-user/elfload.c: Replaced calls to malloc/free with G


From: Mahmoud Mandour
Subject: Re: [PATCH 1/8] bsd-user/elfload.c: Replaced calls to malloc/free with GLib variants
Date: Mon, 15 Mar 2021 18:22:24 +0200

Given this is start-up code I think you could use g_new instead of
g_try_new. As it will abort on no memory you can avoid the early return
check bellow. Also is elf_phdata never persists beyond this function you
could use g_autofree (and use g_steal_pointer on the one case when it is
returned if you need it)

I would also split this patch, one for each function you convert.
 
Thank you for the valuable suggestions, these are obviously the better 
way to go. I will hopefully employ them.
I'm now busy with my final exams. In a week or so, I will make the 
changes again and properly, split the patch, and then send it as a 
series regarding this file.

Thanks
Mahmoud Mandour

reply via email to

[Prev in Thread] Current Thread [Next in Thread]