Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: Alan Hayward <Alan.Hayward@arm.com>
Cc: "gdb-patches\@sourceware.org" <gdb-patches@sourceware.org>,
	 nd <nd@arm.com>
Subject: Re: [PATCH] Remove MAX_REGISTER_SIZE from py-unwind.c
Date: Thu, 22 Jun 2017 09:08:00 -0000	[thread overview]
Message-ID: <86bmpgjso6.fsf@gmail.com> (raw)
In-Reply-To: <E4218BDE-2A92-490F-9443-27E25F4237C4@arm.com> (Alan Hayward's	message of "Mon, 12 Jun 2017 09:28:29 +0000")

Alan Hayward <Alan.Hayward@arm.com> writes:

>      cached_frame
> -      = ((cached_frame_info *)
> -	 xmalloc (sizeof (*cached_frame)
> -		  + reg_count * sizeof (cached_frame->reg[0])));
> +      = ((cached_frame_info *) xmalloc (sizeof (*cached_frame)));

Use XNEW, the code can be shorter,

> @@ -601,6 +591,13 @@ static void
>  pyuw_dealloc_cache (struct frame_info *this_frame, void *cache)
>  {
>    TRACE_PY_UNWIND (3, "%s: enter", __FUNCTION__);
> +  cached_frame_info *cached_frame = (cached_frame_info *) cache;
> +
> +  for (int i = 0; cached_frame->reg_count; i++)
> +    {
> +      xfree (cached_frame->reg[i].data);
> +    }

No need to use braces.

Otherwise, patch is good to me.

-- 
Yao (齐尧)


  parent reply	other threads:[~2017-06-22  9:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E4218BDE-2A92-490F-9443-27E25F4237C4@arm.com>
2017-06-21  9:30 ` Alan Hayward
2017-06-22  9:08 ` Yao Qi [this message]
2017-06-22 13:13   ` Alan Hayward
     [not found]     ` <8b641cf5-6cdc-5c4e-6f85-eb28f08bed9c@redhat.com>
2017-06-22 14:36       ` Alan Hayward
2017-06-22 15:25         ` Pedro Alves

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=86bmpgjso6.fsf@gmail.com \
    --to=qiyaoltc@gmail.com \
    --cc=Alan.Hayward@arm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=nd@arm.com \
    /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