From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18487 invoked by alias); 28 Jun 2017 10:36:43 -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 18470 invoked by uid 89); 28 Jun 2017 10:36:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=ham version=3.3.2 spammy=H*r:sk:static. X-HELO: mail-it0-f54.google.com Received: from mail-it0-f54.google.com (HELO mail-it0-f54.google.com) (209.85.214.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 28 Jun 2017 10:36:42 +0000 Received: by mail-it0-f54.google.com with SMTP id v202so5239113itb.1 for ; Wed, 28 Jun 2017 03:36:41 -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=q97BlmWU1PN4pjUKGn1OYu5OVEj7258uApN1IuqQA2U=; b=qgZGch/bkIVHifk2troTtEnNgDK9+4yIU+5tjxZFeslV/pjjJfqMbpckYuYfHcc7T4 X3qfAJKWD7EPcsnm22cj0VzT66dURLUWiDVAUjICZQKSpEgu5hFdi7De7RexQgCwpxt8 9JQZo/P7QNxun4FEBP0WisK0onOszkmqlikr0fLyppxcnmA0xBn7krMlKSxyUjcowJca 9oKgIbLO2XggMkW6SzDRKdXmWffNO/KWJbb0Q6ZMka7PNw/LrPJJU3nSz2XJZZ6vEcqd 8HNMPMIvSd67P3zqWO7DGuQKD/dhXO10KIAchqpmQXtDYxqWN3hq3Nn6Lwo5vdsp6FDh 7uLg== X-Gm-Message-State: AKS2vOw8A5+Pi2H2xV9/FX3ickFCXlY9Mi4jsD9ENmfTu9uzPS/UKh9V I7Qyc3y4MYPOJxxA X-Received: by 10.36.82.82 with SMTP id d79mr5303222itb.8.1498646200357; Wed, 28 Jun 2017 03:36:40 -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 199sm2649726itm.14.2017.06.28.03.36.39 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Wed, 28 Jun 2017 03:36:39 -0700 (PDT) From: Yao Qi To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 02/40] Eliminate make_cleanup_obstack_free, introduce auto_obstack References: <1496406158-12663-1-git-send-email-palves@redhat.com> <1496406158-12663-3-git-send-email-palves@redhat.com> Date: Wed, 28 Jun 2017 10:36:00 -0000 In-Reply-To: <1496406158-12663-3-git-send-email-palves@redhat.com> (Pedro Alves's message of "Fri, 2 Jun 2017 13:22:00 +0100") Message-ID: <86lgoce6vh.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/msg00760.txt.bz2 Pedro Alves writes: > +/* An obstack that frees itself on scope exit. */ > +struct auto_obstack : obstack > +{ > + auto_obstack () > + { obstack_init (this); } > + > + ~auto_obstack () > + { obstack_free (this, NULL); } > + > + /* Free all memory in the obstack but leave it valid for further > + allocation. */ > + void clear () > + { obstack_free (this, obstack_base (this)); } > +}; Hi Pedro, Did you consider "upstream" this to include/obstack.h? so that gcc can use it as well. --=20 Yao (=E9=BD=90=E5=B0=A7)