From patchwork Thu May 10 22:23:48 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 27220 Received: (qmail 47069 invoked by alias); 10 May 2018 22:24:42 -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 42067 invoked by uid 89); 10 May 2018 22:24:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE, TIME_LIMIT_EXCEEDED autolearn=unavailable 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:24:08 +0000 Received: from cm15.websitewelcome.com (cm15.websitewelcome.com [100.42.49.9]) by gateway20.websitewelcome.com (Postfix) with ESMTP id A8EBC400CD332 for ; Thu, 10 May 2018 17:24:06 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id GtyofFDf8bXuJGtyofZ3sk; Thu, 10 May 2018 17:24:06 -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 1fGtyo-001ijL-Fb; Thu, 10 May 2018 17:24:06 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFA 06/15] Change create_demangled_names_hash to take an objfile_per_bfd_storage Date: Thu, 10 May 2018 16:23:48 -0600 Message-Id: <20180510222357.27332-7-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: 1fGtyo-001ijL-Fb 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: 7 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes This changes create_demangled_names_hash to take an objfile_per_bfd_storage parameter. This makes it clearer where it is storing the objects it allocates. 2018-05-09 Tom Tromey * symtab.c (create_demangled_names_hash): Change argument to be an objfile_per_bfd_storage. (symbol_set_names): Update. --- gdb/ChangeLog | 6 ++++++ gdb/symtab.c | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/gdb/symtab.c b/gdb/symtab.c index e1f033d1d8..7426770e9e 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -708,14 +708,14 @@ eq_demangled_name_entry (const void *a, const void *b) name. The entry is hashed via just the mangled name. */ static void -create_demangled_names_hash (struct objfile *objfile) +create_demangled_names_hash (struct objfile_per_bfd_storage *per_bfd) { /* Choose 256 as the starting size of the hash table, somewhat arbitrarily. The hash table code will round this up to the next prime number. Choosing a much larger table size wastes memory, and saves only about 1% in symbol reading. */ - objfile->per_bfd->demangled_names_hash = htab_create_alloc + per_bfd->demangled_names_hash = htab_create_alloc (256, hash_demangled_name_entry, eq_demangled_name_entry, NULL, xcalloc, xfree); } @@ -802,7 +802,7 @@ symbol_set_names (struct general_symbol_info *gsymbol, } if (per_bfd->demangled_names_hash == NULL) - create_demangled_names_hash (objfile); + create_demangled_names_hash (per_bfd); if (linkage_name[len] != '\0') {