Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
Cc: <gdb-patches@sourceware.org>, "'Maxim Grigoriev'" <maxim@tensilica.com>
Subject: Re: [RFA] xtensa-tdep.c ARI fixes
Date: Thu, 14 Apr 2011 20:31:00 -0000	[thread overview]
Message-ID: <m34o60fuc2.fsf@fleche.redhat.com> (raw)
In-Reply-To: <15837.6740910628$1302342165@news.gmane.org> (Pierre Muller's	message of "Sat, 9 Apr 2011 11:42:29 +0200")

>>>>> "Pierre" == Pierre Muller <pierre.muller@ics-cnrs.unistra.fr> writes:

Pierre>   The only non-trivial change is in xtensa_register_type:
Pierre> this is mainly because I do not understand the old code:
Pierre> it was using both xmalloc and strdup, which should
Pierre> create a memory leak, no?
Pierre>   But maybe I miss something?

I agree.

Pierre> -		  char *name = xmalloc (16);
Pierre> +		  char *name = xstrprintf ("int%d", size * 8);

Looks better.

Pierre> +		    = arch_integer_type (gdbarch, size * 8, 1, name);

arch_integer_type calls arch_type, which calls xstrdup(name).
So I think you need to xfree name here.

Tom


       reply	other threads:[~2011-04-14 20:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <15837.6740910628$1302342165@news.gmane.org>
2011-04-14 20:31 ` Tom Tromey [this message]
2011-04-15  1:07   ` Maxim Grigoriev
2011-04-15  7:40   ` [RFA-v2] " Pierre Muller
     [not found]   ` <37948.3434990563$1302853234@news.gmane.org>
2011-04-15 18:22     ` Tom Tromey
2011-04-15 18:37       ` Maxim Grigoriev
2011-04-16 16:07         ` Pierre Muller
     [not found]         ` <31380.6117898368$1302970085@news.gmane.org>
2011-04-18 17:07           ` Tom Tromey
2011-04-19  7:18             ` Pierre Muller
2011-04-09  9:42 [RFA] " Pierre Muller

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=m34o60fuc2.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=maxim@tensilica.com \
    --cc=pierre.muller@ics-cnrs.unistra.fr \
    /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