From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 116542 invoked by alias); 22 Jun 2017 09:08:47 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 116443 invoked by uid 89); 22 Jun 2017 09:08:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:733, H*r:sk:static. X-HELO: mail-io0-f169.google.com Received: from mail-io0-f169.google.com (HELO mail-io0-f169.google.com) (209.85.223.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 22 Jun 2017 09:08:45 +0000 Received: by mail-io0-f169.google.com with SMTP id h134so11043869iof.2 for ; Thu, 22 Jun 2017 02:08:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=k7CsCdIlP5izJVVKTHk9ChB9xpVqapBZhTiW/lQAxBg=; b=Sh8mAlZ3o8NWbVKTOZcbMMqwDKABeDo44qs/5H3V1tSOm+bBXqBSKL2Gm7e1Sa6SGE 3KisrUKzpjk1gsGXkrl2OAdRQZ4IAVQp3L33f/UZQtRnulENRqHFcBzXljujvFcdT+Fy sczklecu59m9uVFioQJcIVKyD5yQ13RRlgozTdWClJdUSQBrIM6ipaa4/XV3Q3sIFVMQ GgVOQadw60b6+0DtJRrzNMroXKToz8HbLT8uAVmgo+yPgNTa+N9tkGraWvTscjqFf+bl nu43wYu6yP4ffNonfrwrDYmaJGdfq0aSZ8sYW5FtXOte6mIJviYsTSBDMvSFxpBB9TVL u++Q== X-Gm-Message-State: AKS2vOyHaymi+nQxAxQsgzy/H1eG9wBoj64458uOBIfVC9nJBCBEOt1O iFAcAlhWeYMScg== X-Received: by 10.107.173.18 with SMTP id w18mr1254030ioe.80.1498122524079; Thu, 22 Jun 2017 02:08:44 -0700 (PDT) Received: from E107787-LIN (static.42.136.251.148.clients.your-server.de. [148.251.136.42]) by smtp.gmail.com with ESMTPSA id 142sm570361itk.30.2017.06.22.02.08.42 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 22 Jun 2017 02:08:43 -0700 (PDT) From: Yao Qi To: Alan Hayward Cc: "gdb-patches\@sourceware.org" , nd Subject: Re: [PATCH] Remove MAX_REGISTER_SIZE from py-unwind.c References: Date: Thu, 22 Jun 2017 09:08:00 -0000 In-Reply-To: (Alan Hayward's message of "Mon, 12 Jun 2017 09:28:29 +0000") Message-ID: <86bmpgjso6.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2017-06/txt/msg00624.txt.bz2 Alan Hayward writes: > cached_frame > - =3D ((cached_frame_info *) > - xmalloc (sizeof (*cached_frame) > - + reg_count * sizeof (cached_frame->reg[0]))); > + =3D ((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 =3D (cached_frame_info *) cache; > + > + for (int i =3D 0; cached_frame->reg_count; i++) > + { > + xfree (cached_frame->reg[i].data); > + } No need to use braces. Otherwise, patch is good to me. --=20 Yao (=E9=BD=90=E5=B0=A7)