qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Marcel Apfelbaum <marcel.a@redhat.com>
To: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
	"Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] small memory leak due to MachineClass rework
Date: Mon, 17 Mar 2014 23:43:21 +0200	[thread overview]
Message-ID: <1395092601.3377.2.camel@localhost.localdomain> (raw)
In-Reply-To: <5327691D.3040906@de.ibm.com>

On Mon, 2014-03-17 at 22:29 +0100, Christian Borntraeger wrote:
> On 17/03/14 22:25, Peter Maydell wrote:
> > On 17 March 2014 20:56, Christian Borntraeger <borntraeger@de.ibm.com> wrote:
> >> Turns out that valgrind is right. We simply forget the memory that g_strconcat has allocated.
> >> This fixes the small leak, but I have to cast away the constness of .name.
> >> Any better ideas?
> > 
> > It's how cpu_register() in target-arm/cpu.c does the same thing
> > (though we use void* rather than gpointer as the cast).
> 
> Ok, if you dont have a problem with that approach, I can submit a proper
> patch with signoff.  Any preference regarding void * vs gpointer?
Hi Cristian,

Thank you for catching this! (I also would go with void *)
Marcel

> 
> Christian
> 
> 
> > If you really dislike the const I guess you could use:
> >     char *name = g_strconcat(...);
> >     TypeInfo ti = {
> >           .name = name,
> >           [...]
> >     };
> >     [...]
> >     g_free(name);
> > 
> 
> 

  parent reply	other threads:[~2014-03-17 21:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-17 20:56 [Qemu-devel] small memory leak due to MachineClass rework Christian Borntraeger
2014-03-17 21:25 ` Peter Maydell
2014-03-17 21:29   ` Christian Borntraeger
2014-03-17 21:38     ` Andreas Färber
2014-03-17 21:43     ` Marcel Apfelbaum [this message]
2014-03-18 14:57 ` Michael S. Tsirkin

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=1395092601.3377.2.camel@localhost.localdomain \
    --to=marcel.a@redhat.com \
    --cc=afaerber@suse.de \
    --cc=borntraeger@de.ibm.com \
    --cc=mst@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).