qemu-trivial
[Top][All Lists]
Advanced

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

[Qemu-trivial] [PATCH 62/88] user: use g_new() family of functions


From: Philippe Mathieu-Daudé
Subject: [Qemu-trivial] [PATCH 62/88] user: use g_new() family of functions
Date: Fri, 6 Oct 2017 20:49:57 -0300

From: Marc-André Lureau <address@hidden>

Signed-off-by: Marc-André Lureau <address@hidden>
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
[PMD: added linux-user/elfload.c]
---
 linux-user/elfload.c | 2 +-
 thunk.c              | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 79062882ba..0a826071e9 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -3014,7 +3014,7 @@ static void fill_thread_info(struct elf_note_info *info, 
const CPUArchState *env
     TaskState *ts = (TaskState *)cpu->opaque;
     struct elf_thread_status *ets;
 
-    ets = g_malloc0(sizeof (*ets));
+    ets = g_new0(struct elf_thread_status, 1);
     ets->num_notes = 1; /* only prstatus is dumped */
     fill_prstatus(&ets->prstatus, ts, 0);
     elf_core_copy_regs(&ets->prstatus.pr_reg, env);
diff --git a/thunk.c b/thunk.c
index d5d8645cd4..17f3d320bb 100644
--- a/thunk.c
+++ b/thunk.c
@@ -89,7 +89,7 @@ void thunk_register_struct(int id, const char *name, const 
argtype *types)
     for(i = 0;i < 2; i++) {
         offset = 0;
         max_align = 1;
-        se->field_offsets[i] = malloc(nb_fields * sizeof(int));
+        se->field_offsets[i] = g_new(int, nb_fields);
         type_ptr = se->field_types;
         for(j = 0;j < nb_fields; j++) {
             size = thunk_type_size(type_ptr, i);
-- 
2.14.2




reply via email to

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