From patchwork Sun Nov 25 19:20:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 30292 Received: (qmail 29574 invoked by alias); 25 Nov 2018 19:20:53 -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 29499 invoked by uid 89); 25 Nov 2018 19:20:50 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.4 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.2 spammy=Hx-languages-length:1594, (unknown), allocates X-HELO: gateway24.websitewelcome.com Received: from gateway24.websitewelcome.com (HELO gateway24.websitewelcome.com) (192.185.50.66) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 25 Nov 2018 19:20:48 +0000 Received: from cm12.websitewelcome.com (cm12.websitewelcome.com [100.42.49.8]) by gateway24.websitewelcome.com (Postfix) with ESMTP id 86D1EA306 for ; Sun, 25 Nov 2018 13:20:47 -0600 (CST) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id QzxXgGCZzSjJAQzxXge7qY; Sun, 25 Nov 2018 13:20:47 -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=P4wuvPYSpcsG3beGO6lU4rZceeIdOMGtJBq+tjvz4BQ=; b=i6GjB0e9Yj/g0/W202U5l8xtPQ P8WcW1Mwx+5jUxkr8q/SEfBMdR/WJx3RG1n5DN7IyXKN7IE0rLHwHSn/5+m27xHJOmhAnK4jPyplF RqK3FDw8kB9dPfLIifodxc5t9; Received: from 97-122-190-66.hlrn.qwest.net ([97.122.190.66]:52060 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1gQzxX-001TOx-B2; Sun, 25 Nov 2018 13:20:47 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH v2 04/12] Change create_demangled_names_hash to take an objfile_per_bfd_storage Date: Sun, 25 Nov 2018 12:20:35 -0700 Message-Id: <20181125192043.8405-5-tom@tromey.com> In-Reply-To: <20181125192043.8405-1-tom@tromey.com> References: <20181125192043.8405-1-tom@tromey.com> 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. gdb/ChangeLog 2018-11-25 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 f8c755fdab..2911e5c83c 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -709,14 +709,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); } @@ -803,7 +803,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') {