public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Populate seen_names hash in cooked_index_shard::do_finalize
@ 2023-03-27 14:19 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2023-03-27 14:19 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=b6c55de76b1a30debca52f52c479ca3b8e3fee53

commit b6c55de76b1a30debca52f52c479ca3b8e3fee53
Author: Tom Tromey <tromey@adacore.com>
Date:   Fri Feb 10 07:18:15 2023 -0700

    Populate seen_names hash in cooked_index_shard::do_finalize
    
    Hannes pointed out that cooked_index_shard::do_finalize never
    populates the seen_names hash table.  This patch adds the necessary
    store.  This reduces memory use a little for "gdb gdb":
    
    (before) Space used: 28909568 (+0 for this command)
    (after)  Space used: 28884992 (+0 for this command)
    
    What this means, btw, is that in gdb there are not many symbols that
    are both mentioned in many CUs and that also require name
    canonicalization.  It's possible this would differ in other programs.

Diff:
---
 gdb/dwarf2/cooked-index.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gdb/dwarf2/cooked-index.c b/gdb/dwarf2/cooked-index.c
index 3a907690906..900f13c7de9 100644
--- a/gdb/dwarf2/cooked-index.c
+++ b/gdb/dwarf2/cooked-index.c
@@ -378,6 +378,7 @@ cooked_index_shard::do_finalize ()
 		  entry->canonical = canon_name.get ();
 		  m_names.push_back (std::move (canon_name));
 		}
+	      *slot = entry;
 	    }
 	  else
 	    {

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-27 14:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-27 14:19 [binutils-gdb] Populate seen_names hash in cooked_index_shard::do_finalize Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).