From nobody Tue Feb 10 23:00:52 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1507335512697644.6527685903524; Fri, 6 Oct 2017 17:18:32 -0700 (PDT) Received: from localhost ([::1]:47675 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cor-0005BG-Da for importer@patchew.org; Fri, 06 Oct 2017 20:18:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41790) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e0cQ6-00006s-Ij for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:52:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e0cQ3-00061p-W3 for qemu-devel@nongnu.org; Fri, 06 Oct 2017 19:52:42 -0400 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]:34137) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e0cQ3-00061R-Rd; Fri, 06 Oct 2017 19:52:39 -0400 Received: by mail-qk0-x242.google.com with SMTP id b124so10271806qke.1; Fri, 06 Oct 2017 16:52:39 -0700 (PDT) Received: from yoga.lan ([181.93.89.178]) by smtp.gmail.com with ESMTPSA id g1sm1705226qta.95.2017.10.06.16.52.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Oct 2017 16:52:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=M4IUFxRt43tOeleQ/oW6MuO4gBsc7lh2yeWA0NF33bg=; b=iUTEL3c8eWVb91OABhBwtGEQm04vpilaNKCqJiHidInOUUf3dAoUTnBMzh9UXXGLaZ x932PrO4SERgHuehgpRvNS8J2lEFBksh8lVM+otGMKih4F9DLaEebBSRw0h07MsbRFHV 1DOhU+zX52+9mPSmYEgccQD01AHTRSPmUjOx6NvaTRGG6IZGTbMhtd4bReYnka5UK7/X gnd636+Fq721H2kzxh8KtKGpDz3hr3bRbgq6goymWuZcgusvNXdu2sdAFkJfOf/BQ7lC 3C7R2UJ5G6jYvMccHiV/GnvupY0N4CaM2Y6sqJ+yG6XJfYY7wKBsc/GxJyiq96wHskw6 We9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=M4IUFxRt43tOeleQ/oW6MuO4gBsc7lh2yeWA0NF33bg=; b=QRWxMPfHlPO8Vprb7GcU/7ujBmarYl27mCmcw4W8xim4M7LuFGeLASJmOYwscc2vHc umgwHsaekPnniB6fKFtrLy1CiPocTJXhHLdfVX6JWfqhXjP0dBlydSYymXAFUqPu+LTD 3xT6JPREDiANLr/L1tN73kBQ9o22w657C1GnuD0tADO1Rj8Kqn9752ilX4TQVT7Lwbir DMayXDDu3YOEHsoEmAkzgMTu6ARVPzL3+gHgr/BTfh814Z2SschzYBP4J0+uMmkUrqD9 vH9kffzpyn+OiWJuhZFuK1lWkEaoFzUoWnLRwLwfYBc1xzpUu8olDthrP5lxOJiPQwMV ptpA== X-Gm-Message-State: AMCzsaVd5tiJCT5TwfbBLcyQ8+rd+FPyeMwEzMNHynm7B7qO6IEzDYHg QMz2COcG4QdZ1lEi3/iuEcA= X-Google-Smtp-Source: AOwi7QAmS3cIH6a6Fg1iuKr/rHfs3SguHJ3n2PLMH1CzZvuctkmsMMBJLHCmx2szyPog6rGGuCE3sg== X-Received: by 10.55.91.69 with SMTP id p66mr692259qkb.167.1507333959328; Fri, 06 Oct 2017 16:52:39 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Markus Armbruster , Eric Blake , Richard Henderson , Peter Crosthwaite , Paolo Bonzini Date: Fri, 6 Oct 2017 20:49:32 -0300 Message-Id: <20171006235023.11952-38-f4bug@amsat.org> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171006235023.11952-1-f4bug@amsat.org> References: <20171006235023.11952-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::242 Subject: [Qemu-devel] [PATCH 37/88] TCG: use g_new() family of functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Kevin Wolf , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , qemu trival , qemu-devel@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 From: Marc-Andr=C3=A9 Lureau Signed-off-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Philippe Mathieu-Daud=C3=A9 [PMD: avoid use of g_malloc0() in cpus.c] --- cpus.c | 18 +++++++++--------- tcg/tcg.c | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/cpus.c b/cpus.c index c9a624003a..6dea1c7041 100644 --- a/cpus.c +++ b/cpus.c @@ -1666,8 +1666,8 @@ static void qemu_tcg_init_vcpu(CPUState *cpu) static QemuThread *single_tcg_cpu_thread; =20 if (qemu_tcg_mttcg_enabled() || !single_tcg_cpu_thread) { - cpu->thread =3D g_malloc0(sizeof(QemuThread)); - cpu->halt_cond =3D g_malloc0(sizeof(QemuCond)); + cpu->thread =3D g_new0(QemuThread, 1); + cpu->halt_cond =3D g_new0(QemuCond, 1); qemu_cond_init(cpu->halt_cond); =20 if (qemu_tcg_mttcg_enabled()) { @@ -1706,8 +1706,8 @@ static void qemu_hax_start_vcpu(CPUState *cpu) { char thread_name[VCPU_THREAD_NAME_SIZE]; =20 - cpu->thread =3D g_malloc0(sizeof(QemuThread)); - cpu->halt_cond =3D g_malloc0(sizeof(QemuCond)); + cpu->thread =3D g_new0(QemuThread, 1); + cpu->halt_cond =3D g_new0(QemuCond, 1); qemu_cond_init(cpu->halt_cond); =20 snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "CPU %d/HAX", @@ -1726,8 +1726,8 @@ static void qemu_kvm_start_vcpu(CPUState *cpu) { char thread_name[VCPU_THREAD_NAME_SIZE]; =20 - cpu->thread =3D g_malloc0(sizeof(QemuThread)); - cpu->halt_cond =3D g_malloc0(sizeof(QemuCond)); + cpu->thread =3D g_new0(QemuThread, 1); + cpu->halt_cond =3D g_new0(QemuCond, 1); qemu_cond_init(cpu->halt_cond); snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "CPU %d/KVM", cpu->cpu_index); @@ -1742,8 +1742,8 @@ static void qemu_dummy_start_vcpu(CPUState *cpu) { char thread_name[VCPU_THREAD_NAME_SIZE]; =20 - cpu->thread =3D g_malloc0(sizeof(QemuThread)); - cpu->halt_cond =3D g_malloc0(sizeof(QemuCond)); + cpu->thread =3D g_new0(QemuThread, 1); + cpu->halt_cond =3D g_new0(QemuCond, 1); qemu_cond_init(cpu->halt_cond); snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "CPU %d/DUMMY", cpu->cpu_index); @@ -1931,7 +1931,7 @@ CpuInfoList *qmp_query_cpus(Error **errp) info->value->has_props =3D !!mc->cpu_index_to_instance_props; if (info->value->has_props) { CpuInstanceProperties *props; - props =3D g_malloc0(sizeof(*props)); + props =3D g_malloc(sizeof(*props)); *props =3D mc->cpu_index_to_instance_props(ms, cpu->cpu_index); info->value->props =3D props; } diff --git a/tcg/tcg.c b/tcg/tcg.c index dff9999bc6..d5c1c75aa7 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -342,8 +342,8 @@ void tcg_context_init(TCGContext *s) total_args +=3D n; } =20 - args_ct =3D g_malloc(sizeof(TCGArgConstraint) * total_args); - sorted_args =3D g_malloc(sizeof(int) * total_args); + args_ct =3D g_new(TCGArgConstraint, total_args); + sorted_args =3D g_new(int, total_args); =20 for(op =3D 0; op < NB_OPS; op++) { def =3D &tcg_op_defs[op]; --=20 2.14.2