|
From: | Damien Hedde |
Subject: | Re: [PATCH 1/5] hw/riscv/riscv_hart: free the harts array when the object is finalized |
Date: | Fri, 18 Feb 2022 18:39:42 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 |
On 2/18/22 18:23, Peter Maydell wrote:
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
You're right. I was confused when re-writing the message. This leaks happen on init -> realize-failure -> finalizeBecause the array is allocated, then every cpu is initialized (and an error failure may happen for any of them).
Thanks, -- Damien
[Prev in Thread] | Current Thread | [Next in Thread] |