Message ID | 20200208152758.29385-3-tom@tromey.com |
---|---|
State | New, archived |
Headers |
Received: (qmail 69157 invoked by alias); 8 Feb 2020 15:28:03 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <gdb-patches.sourceware.org> List-Unsubscribe: <mailto:gdb-patches-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:gdb-patches-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 69140 invoked by uid 89); 8 Feb 2020 15:28:03 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-20.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= X-HELO: gateway30.websitewelcome.com Received: from gateway30.websitewelcome.com (HELO gateway30.websitewelcome.com) (192.185.149.4) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 08 Feb 2020 15:28:02 +0000 Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway30.websitewelcome.com (Postfix) with ESMTP id C00AE2C425 for <gdb-patches@sourceware.org>; Sat, 8 Feb 2020 09:28:00 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id 0S1Yj4gAoSl8q0S1Yjp84S; Sat, 08 Feb 2020 09:28:00 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=TTseQo2LrIfTvubWIhhpw9KdP4N91PZz+RyX1krIzFU=; b=jw16YljQA7XiYwwPjtBXVgboUq hu2i5EelEbEhndJhy4L5k3+40cpI9vMQ0t7SML/6x3nx4ZY66/e+QbAlpbglsDZavsK895OEVL8Yt abNIur2B0ejLY6t2zCWX3kRIE; Received: from 75-166-123-50.hlrn.qwest.net ([75.166.123.50]:38112 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from <tom@tromey.com>) id 1j0S1Y-001WwE-Hc; Sat, 08 Feb 2020 08:28:00 -0700 From: Tom Tromey <tom@tromey.com> To: gdb-patches@sourceware.org Cc: Tom Tromey <tom@tromey.com> Subject: [PATCH 2/8] Dont' allow copying of auto_obstack Date: Sat, 8 Feb 2020 08:27:52 -0700 Message-Id: <20200208152758.29385-3-tom@tromey.com> In-Reply-To: <20200208152758.29385-1-tom@tromey.com> References: <20200208152758.29385-1-tom@tromey.com> |
Commit Message
Tom Tromey
Feb. 8, 2020, 3:27 p.m. UTC
Add DISABLE_COPY_AND_ASSIGN to struct auto_obstack, to prevent copying it. Copying an auto_obstack would be a bug. gdb/ChangeLog 2020-02-08 Tom Tromey <tom@tromey.com> * gdb_obstack.h (struct auto_obstack): Use DISABLE_COPY_AND_ASSIGN. Change-Id: Ic9e5ab20acfcfa61c241fed4d99bbb1caefba3cd --- gdb/ChangeLog | 5 +++++ gdb/gdb_obstack.h | 2 ++ 2 files changed, 7 insertions(+)
Comments
On Sat, Feb 8, 2020, 10:28 Tom Tromey <tom@tromey.com> wrote: > Add DISABLE_COPY_AND_ASSIGN to struct auto_obstack, to prevent copying > it. Copying an auto_obstack would be a bug. > Typo in the subject/first line (Dont' -> Don't) > gdb/ChangeLog > 2020-02-08 Tom Tromey <tom@tromey.com> > > * gdb_obstack.h (struct auto_obstack): Use > DISABLE_COPY_AND_ASSIGN. > > Change-Id: Ic9e5ab20acfcfa61c241fed4d99bbb1caefba3cd > --- > gdb/ChangeLog | 5 +++++ > gdb/gdb_obstack.h | 2 ++ > 2 files changed, 7 insertions(+) > > diff --git a/gdb/gdb_obstack.h b/gdb/gdb_obstack.h > index fb9295f5020..9b1d907678f 100644 > --- a/gdb/gdb_obstack.h > +++ b/gdb/gdb_obstack.h > @@ -125,6 +125,8 @@ struct auto_obstack : obstack > ~auto_obstack () > { obstack_free (this, NULL); } > > + DISABLE_COPY_AND_ASSIGN (auto_obstack); > + > /* Free all memory in the obstack but leave it valid for further > allocation. */ > void clear () > -- > 2.17.2 > >
>>>>> "Christian" == Christian Biesinger <cbiesinger@google.com> writes: > On Sat, Feb 8, 2020, 10:28 Tom Tromey <tom@tromey.com> wrote: > Add DISABLE_COPY_AND_ASSIGN to struct auto_obstack, to prevent copying > it. Copying an auto_obstack would be a bug. Christian> Typo in the subject/first line (Dont' -> Don't) Thanks, I fixed this. Tom
On 2020-02-11 7:16 p.m., Tom Tromey wrote: >>>>>> "Christian" == Christian Biesinger <cbiesinger@google.com> writes: > >> On Sat, Feb 8, 2020, 10:28 Tom Tromey <tom@tromey.com> wrote: >> Add DISABLE_COPY_AND_ASSIGN to struct auto_obstack, to prevent copying >> it. Copying an auto_obstack would be a bug. > > Christian> Typo in the subject/first line (Dont' -> Don't) > > Thanks, I fixed this. > > Tom > That makes sense, I think you should push this one right away, independently from this series. Simon
>>>>> "Simon" == Simon Marchi <simark@simark.ca> writes:
Simon> That makes sense, I think you should push this one right away, independently
Simon> from this series.
I'll push these first two. Thanks.
Tom
diff --git a/gdb/gdb_obstack.h b/gdb/gdb_obstack.h index fb9295f5020..9b1d907678f 100644 --- a/gdb/gdb_obstack.h +++ b/gdb/gdb_obstack.h @@ -125,6 +125,8 @@ struct auto_obstack : obstack ~auto_obstack () { obstack_free (this, NULL); } + DISABLE_COPY_AND_ASSIGN (auto_obstack); + /* Free all memory in the obstack but leave it valid for further allocation. */ void clear ()