All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: Damien Hedde <damien.hedde@greensocs.com>
Cc: Alistair Francis <alistair.francis@wdc.com>,
	Bin Meng <bin.meng@windriver.com>,
	Palmer Dabbelt <palmer@dabbelt.com>,
	qemu-devel@nongnu.org, qemu-riscv@nongnu.org
Subject: Re: [PATCH 1/5] hw/riscv/riscv_hart: free the harts array when the object is finalized
Date: Fri, 18 Feb 2022 17:23:07 +0000	[thread overview]
Message-ID: <CAFEAcA_xtf-LtvhNqxMEtZs1Z6NePkVKOp6Kh+tN_HZTkFiuTQ@mail.gmail.com> (raw)
In-Reply-To: <20220218164646.132112-2-damien.hedde@greensocs.com>

On Fri, 18 Feb 2022 at 16:53, Damien Hedde <damien.hedde@greensocs.com> wrote:
>
> The array is dynamically allocated by realize() depending on the
> number of harts.
>
> This clean-up removes memory leaks which would happen in the
> 'init->finalize' life-cycle use-case (happening when user creation
> is allowed).

If the allocation happens in realize, then it won't hapen
in an init->finalize cycle, only in init->realize->unrealize->finalize...

-- PMM


WARNING: multiple messages have this Message-ID (diff)
From: Peter Maydell <peter.maydell@linaro.org>
To: Damien Hedde <damien.hedde@greensocs.com>
Cc: qemu-devel@nongnu.org, Palmer Dabbelt <palmer@dabbelt.com>,
	 Bin Meng <bin.meng@windriver.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	qemu-riscv@nongnu.org
Subject: Re: [PATCH 1/5] hw/riscv/riscv_hart: free the harts array when the object is finalized
Date: Fri, 18 Feb 2022 17:23:07 +0000	[thread overview]
Message-ID: <CAFEAcA_xtf-LtvhNqxMEtZs1Z6NePkVKOp6Kh+tN_HZTkFiuTQ@mail.gmail.com> (raw)
In-Reply-To: <20220218164646.132112-2-damien.hedde@greensocs.com>

On Fri, 18 Feb 2022 at 16:53, Damien Hedde <damien.hedde@greensocs.com> wrote:
>
> The array is dynamically allocated by realize() depending on the
> number of harts.
>
> This clean-up removes memory leaks which would happen in the
> 'init->finalize' life-cycle use-case (happening when user creation
> is allowed).

If the allocation happens in realize, then it won't hapen
in an init->finalize cycle, only in init->realize->unrealize->finalize...

-- PMM


  reply	other threads:[~2022-02-18 17:25 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-18 16:46 [PATCH 0/5] RiscV cleanups for user-related life cycles Damien Hedde
2022-02-18 16:46 ` Damien Hedde
2022-02-18 16:46 ` [PATCH 1/5] hw/riscv/riscv_hart: free the harts array when the object is finalized Damien Hedde
2022-02-18 16:46   ` Damien Hedde
2022-02-18 17:23   ` Peter Maydell [this message]
2022-02-18 17:23     ` Peter Maydell
2022-02-18 17:39     ` Damien Hedde
2022-02-18 17:39       ` Damien Hedde
2022-02-18 17:46       ` Peter Maydell
2022-02-18 17:46         ` Peter Maydell
2022-02-21 10:29         ` Damien Hedde
2022-02-21 10:29           ` Damien Hedde
2022-02-18 16:46 ` [PATCH 2/5] target/riscv: add riscv_cpu_release_claimed_interrupts function Damien Hedde
2022-02-18 16:46   ` Damien Hedde
2022-02-18 16:46 ` [PATCH 3/5] hw/intc/sifive_plic: report errors and free allocated memory Damien Hedde
2022-02-18 16:46   ` Damien Hedde
2022-02-18 16:46 ` [PATCH 4/5] hw/intc/riscv_aclint: swi: " Damien Hedde
2022-02-18 16:46   ` Damien Hedde
2022-02-18 16:46 ` [PATCH 5/5] hw/intc/riscv_aclint: mtimer: " Damien Hedde
2022-02-18 16:46   ` Damien Hedde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFEAcA_xtf-LtvhNqxMEtZs1Z6NePkVKOp6Kh+tN_HZTkFiuTQ@mail.gmail.com \
    --to=peter.maydell@linaro.org \
    --cc=alistair.francis@wdc.com \
    --cc=bin.meng@windriver.com \
    --cc=damien.hedde@greensocs.com \
    --cc=palmer@dabbelt.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.