From patchwork Thu May 10 22:23:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 27231 Received: (qmail 96076 invoked by alias); 10 May 2018 22:45:37 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 95592 invoked by uid 89); 10 May 2018 22:45:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_STOCKGEN, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: gateway20.websitewelcome.com Received: from gateway20.websitewelcome.com (HELO gateway20.websitewelcome.com) (192.185.49.40) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 10 May 2018 22:45:04 +0000 Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway20.websitewelcome.com (Postfix) with ESMTP id A419E400CE50B for ; Thu, 10 May 2018 17:24:08 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id GtyqfKoS8WCOCGtyqfCetz; Thu, 10 May 2018 17:24:08 -0500 X-Authority-Reason: nr=8 Received: from 97-122-176-117.hlrn.qwest.net ([97.122.176.117]:54520 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1fGtyq-001ijL-FL; Thu, 10 May 2018 17:24:08 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFA 12/15] Move more allocations to psymtab obstack Date: Thu, 10 May 2018 16:23:54 -0600 Message-Id: <20180510222357.27332-13-tom@tromey.com> In-Reply-To: <20180510222357.27332-1-tom@tromey.com> References: <20180510222357.27332-1-tom@tromey.com> X-BWhitelist: no X-Source-L: No X-Exim-ID: 1fGtyq-001ijL-FL X-Source-Sender: 97-122-176-117.hlrn.qwest.net (bapiya.Home) [97.122.176.117]:54520 X-Source-Auth: tom+tromey.com X-Email-Count: 13 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes This moves a couple more psymtab-related allocations to the psymtab obstack. 2018-05-10 Tom Tromey * psymtab.c (add_psymbol_to_bcache): Pass psymtab obstack to PSYMBOL_SET_LANGUAGE. (allocate_psymtab): Allocate psymtab on the psymtab obstack. --- gdb/ChangeLog | 6 ++++++ gdb/psymtab.c | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/gdb/psymtab.c b/gdb/psymtab.c index a7bec436e0..d121eace54 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -1695,7 +1695,8 @@ add_psymbol_to_bcache (const char *name, int namelength, int copy_name, SET_PSYMBOL_VALUE_ADDRESS (&psymbol, coreaddr); PSYMBOL_SECTION (&psymbol) = section; - PSYMBOL_SET_LANGUAGE (&psymbol, language, &objfile->objfile_obstack); + PSYMBOL_SET_LANGUAGE (&psymbol, language, + objfile->partial_symtabs->obstack ()); PSYMBOL_DOMAIN (&psymbol) = domain; PSYMBOL_CLASS (&psymbol) = theclass; @@ -1783,7 +1784,7 @@ allocate_psymtab (const char *filename, struct objfile *objfile) } else psymtab = (struct partial_symtab *) - obstack_alloc (&objfile->objfile_obstack, + obstack_alloc (objfile->partial_symtabs->obstack (), sizeof (struct partial_symtab)); memset (psymtab, 0, sizeof (struct partial_symtab));