From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45457) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0W05-000200-DE for qemu-devel@nongnu.org; Thu, 04 Jun 2015 10:20:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z0W00-0007ln-31 for qemu-devel@nongnu.org; Thu, 04 Jun 2015 10:20:05 -0400 Received: from mail-pd0-f176.google.com ([209.85.192.176]:35537) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0Vzz-0007kl-Ts for qemu-devel@nongnu.org; Thu, 04 Jun 2015 10:20:00 -0400 Received: by pdbnf5 with SMTP id nf5so32020775pdb.2 for ; Thu, 04 Jun 2015 07:19:58 -0700 (PDT) Message-ID: <55705E8B.4080400@linaro.org> Date: Thu, 04 Jun 2015 22:19:55 +0800 From: Shannon Zhao MIME-Version: 1.0 References: <1432972477-13504-1-git-send-email-zhaoshenglong@huawei.com> <1432972477-13504-2-git-send-email-zhaoshenglong@huawei.com> <55705CE0.1040108@msgid.tls.msk.ru> In-Reply-To: <55705CE0.1040108@msgid.tls.msk.ru> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Qemu-trivial] [PATCH v2 1/7] hw/ppc/ppc440_bamboo.c: Add a member in MachineState to store irq array List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Michael Tokarev , Shannon Zhao , qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, peter.maydell@linaro.org On 2015/6/4 22:12, Michael Tokarev wrote: > 30.05.2015 10:54, Shannon Zhao wrote: >> >From: Shannon Zhao >> > >> >Here we add a member in MachineState to store the irq array returned >> >from qemu_allocate_irqs. Then these irq arrays will be free before QEMU >> >exit and it fixes the memory leak spotted by valgrind. > Where the new member (machine->irqs) is being freed? The machine->irqs will not be freed until the machine dies. Since machine init function only runs once and the allocated memories could be freed when QEMU exits. > Can we add the > generic machinery for it first, and next convert all places to it one > by one? -- Shannon