aboutsummaryrefslogtreecommitdiff
path: root/gold/main.cc
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2007-12-14 05:24:17 +0000
committerIan Lance Taylor <iant@google.com>2007-12-14 05:24:17 +0000
commit6d01333390a0047a4e8ec0d69f4d1c8f43c3fc55 (patch)
treeaa539a8dc67b986680175065607f9f51c471b831 /gold/main.cc
parent460c00b558bc0cf4501c514b0ff13c7d48750165 (diff)
downloadgdb-6d01333390a0047a4e8ec0d69f4d1c8f43c3fc55.zip
gdb-6d01333390a0047a4e8ec0d69f4d1c8f43c3fc55.tar.gz
gdb-6d01333390a0047a4e8ec0d69f4d1c8f43c3fc55.tar.bz2
From Craig Silverstein: size hash tables to avoid resizing.
Diffstat (limited to 'gold/main.cc')
-rw-r--r--gold/main.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/gold/main.cc b/gold/main.cc
index 921d148..c7c2d95 100644
--- a/gold/main.cc
+++ b/gold/main.cc
@@ -75,8 +75,11 @@ main(int argc, char** argv)
// The list of input objects.
Input_objects input_objects;
- // The symbol table.
- Symbol_table symtab;
+ // The symbol table. We're going to guess here how many symbols
+ // we're going to see based on the number of input files. Even when
+ // this is off, it means at worse we don't quite optimize hashtable
+ // resizing as well as we could have (perhap using more memory).
+ Symbol_table symtab(command_line.number_of_input_files() * 1024);
// The layout object.
Layout layout(command_line.options());