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

2021-03-15 Thread Alex Bennée
Mahmoud Mandour writes: > 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

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

2021-03-15 Thread Mahmoud Mandour
> > 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 >

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

2021-03-15 Thread Alex Bennée
Mahmoud Mandour writes: > Replaced the calls to malloc(), realloc(), and free() to their > equivalents in GLib's allocation functions in various places. > > Signed-off-by: Mahmoud Mandour > --- > bsd-user/elfload.c | 74 +++--- > 1 file changed, 37

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

2021-03-13 Thread Mahmoud Mandour
Replaced the calls to malloc(), realloc(), and free() to their equivalents in GLib's allocation functions in various places. Signed-off-by: Mahmoud Mandour --- bsd-user/elfload.c | 74 +++--- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git