Re: [Qemu-devel] [PATCH v6] linux-user/syscall.c: malloc()/calloc() to g_malloc()/g_try_malloc()/g_new0()

2015-10-12 Thread Harmandeep Kaur
On Mon, Oct 12, 2015 at 6:36 PM, Riku Voipio wrote: > Please use git send-email next time, I needed to manually fix the patch to > apply. > Sorry for that. I will keep in mind next time. > > Applied to linux-user, thanks. > Welcome :)

[Qemu-devel] [PATCH v6] linux-user/syscall.c: malloc()/calloc() to g_malloc()/g_try_malloc()/g_new0()

2015-10-06 Thread Harmandeep Kaur
Convert malloc()/ calloc() calls to g_malloc()/ g_try_malloc()/ g_new0() All heap memory allocation should go through glib so that we can take advantage of a single memory allocator and its debugging/tracing features. Signed-off-by: Harmandeep Kaur --- v1->v2 convert the free() call

[Qemu-devel] [PATCH v5] linux-user/syscall.c: malloc()/calloc() to g_malloc()/g_try_malloc()/g_new0()

2015-10-06 Thread Harmandeep Kaur
Convert malloc()/ calloc() calls to g_malloc()/ g_try_malloc()/ g_new0() Using GLib functions there is no need to check return value. It aborts the execution if allocation fails (in most of the cases). Signed-off-by: Harmandeep Kaur --- v1->v2 convert the free() call in host_to_target_semar

Re: [Qemu-devel] [PATCH v4] linux-user/syscall.c: malloc()/calloc() to g_malloc()/g_try_malloc()/g_new0()

2015-10-06 Thread Harmandeep Kaur
On Tue, Oct 6, 2015 at 4:11 PM, Riku Voipio wrote: > On maanantaina 5. lokakuuta 2015 6.32.27 EEST, Harmandeep Kaur wrote: > >> Convert malloc()/calloc() calls to g_malloc()/g_try_malloc()/g_new0() >> in linux-user/syscall.c file >> >> > @@ -7723,7 +7723,7 @@

[Qemu-devel] [PATCH v4] linux-user/syscall.c: malloc()/calloc() to g_malloc()/g_try_malloc()/g_new0()

2015-10-04 Thread Harmandeep Kaur
Convert malloc()/calloc() calls to g_malloc()/g_try_malloc()/g_new0() in linux-user/syscall.c file Signed-off-by: Harmandeep Kaur --- v1->v2 convert the free() call in host_to_target_semarray() to g_free() and calls g_try_malloc(count) instead of g_try_malloc(sizeof(count)) v2->v

[Qemu-devel] [PATCH v3] linux-user/syscall.c: malloc()/calloc() to g_malloc()/g_try_malloc()/g_new0()

2015-10-01 Thread Harmandeep Kaur
v1-> Convert malloc()/calloc() calls to g_malloc()/g_try_malloc()/g_new0() in linux-user/syscall.c file v1->v2 convert the free() call in host_to_target_semarray() to g_free() and calls g_try_malloc(count) instead of g_try_malloc(sizeof(count)) Signed-off-by: Harmandeep Kaur --- v2-&g

Re: [Qemu-devel] [PATCH v2] linux-user/syscall.c: malloc()/calloc() to g_malloc()/g_try_malloc()/g_new0()

2015-10-01 Thread Harmandeep Kaur
(long)); > -if (!host_mb) { > -unlock_user_struct(target_mb, msgp, 0); > -return -TARGET_ENOMEM; > -} > +host_mb = g_malloc(msgsz+sizeof(long)); On Thu, Oct 1, 2015 at 9:42 PM, Harmandeep Kaur wrote: > Hi Peter, > > Can you please tell me

Re: [Qemu-devel] [PATCH v2] linux-user/syscall.c: malloc()/calloc() to g_malloc()/g_try_malloc()/g_new0()

2015-10-01 Thread Harmandeep Kaur
Hi Peter, Can you please tell me if I should use other glib functions, or implement it in any other way? I am newbie here :) Thank you for reviewing my patch. On Thu, Oct 1, 2015 at 9:33 PM, Peter Maydell wrote: > On 1 October 2015 at 06:32, Harmandeep Kaur > wrote: > > Co

Re: [Qemu-devel] [PATCH v2] linux-user/syscall.c: malloc()/calloc() to g_malloc()/g_try_malloc()/g_new0()

2015-10-01 Thread Harmandeep Kaur
Thank you Eric for guiding me in the right direction. I look forward to implement this correctly. On Thu, Oct 1, 2015 at 9:27 PM, Eric Blake wrote: > On 09/30/2015 11:32 PM, Harmandeep Kaur wrote: > > Convert malloc()/calloc() calls to g_malloc()/g_try_malloc()/g_new0() > >

[Qemu-devel] [PATCH v2] linux-user/syscall.c: malloc()/calloc() to g_malloc()/g_try_malloc()/g_new0()

2015-10-01 Thread Harmandeep Kaur
Convert malloc()/calloc() calls to g_malloc()/g_try_malloc()/g_new0() in linux-user/syscall.c file v1->v2 convert the free() call in host_to_target_semarray() to g_free() and calls g_try_malloc(count) instead of g_try_malloc(sizeof(count)) Signed-off-by: Harmandeep Kaur --- linux-u

Re: [Qemu-devel] [PATCH] linux-user/syscall.c: malloc()/calloc() to g_malloc()/g_try_malloc()/g_new0()

2015-10-01 Thread Harmandeep Kaur
Thank you for the review. I will definitely make the necessary changes. Have a great day. On Thu, Oct 1, 2015 at 12:49 AM, Stefan Hajnoczi wrote: > On Wed, Sep 30, 2015 at 4:32 PM, Harmandeep Kaur > wrote: > > @@ -2672,14 +2663,11 @@ static inline abi_long > target_to_ho

[Qemu-devel] [PATCH] linux-user/syscall.c: malloc()/calloc() to g_malloc()/g_try_malloc()/g_new0()

2015-10-01 Thread Harmandeep Kaur
Convert malloc()/calloc() calls to g_malloc()/g_try_malloc()/g_new0() in linux-user/syscall.c file Signed-off-by: Harmandeep Kaur --- linux-user/syscall.c | 36 ++-- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/linux-user/syscall.c b/linux-user