diff options
author | Ian Lance Taylor <iant@google.com> | 2013-12-19 21:54:43 -0800 |
---|---|---|
committer | Ian Lance Taylor <iant@google.com> | 2013-12-19 21:54:43 -0800 |
commit | 6c09fb0ba1f48543909dea5a988cf8f951699d10 (patch) | |
tree | 5aed356f8040008776d481bc3f9e7e9f4ef0a334 /gold/stringpool.cc | |
parent | 7331bf4ec9af2254904e0b23e822acec8d5ab1f5 (diff) | |
download | fsf-binutils-gdb-6c09fb0ba1f48543909dea5a988cf8f951699d10.zip fsf-binutils-gdb-6c09fb0ba1f48543909dea5a988cf8f951699d10.tar.gz fsf-binutils-gdb-6c09fb0ba1f48543909dea5a988cf8f951699d10.tar.bz2 |
* stringpool.cc (Stringpool_template::reserve): Add
HAVE_UNORDERED_MAP case.
* stringpool.cc (Stringpool_template::print_stats): Likewise.
Diffstat (limited to 'gold/stringpool.cc')
-rw-r--r-- | gold/stringpool.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gold/stringpool.cc b/gold/stringpool.cc index 665fcc8..00ed184 100644 --- a/gold/stringpool.cc +++ b/gold/stringpool.cc @@ -73,7 +73,10 @@ Stringpool_template<Stringpool_char>::reserve(unsigned int n) { this->key_to_offset_.reserve(n); -#if defined(HAVE_TR1_UNORDERED_MAP) +#if defined(HAVE_UNORDERED_MAP) + this->string_set_.rehash(this->string_set_.size() + n); + return; +#elif defined(HAVE_TR1_UNORDERED_MAP) // rehash() implementation is broken in gcc 4.0.3's stl //this->string_set_.rehash(this->string_set_.size() + n); //return; @@ -503,7 +506,7 @@ template<typename Stringpool_char> void Stringpool_template<Stringpool_char>::print_stats(const char* name) const { -#if defined(HAVE_TR1_UNORDERED_MAP) || defined(HAVE_EXT_HASH_MAP) +#if defined(HAVE_UNORDERED_MAP) || defined(HAVE_TR1_UNORDERED_MAP) || defined(HAVE_EXT_HASH_MAP) fprintf(stderr, _("%s: %s entries: %zu; buckets: %zu\n"), program_name, name, this->string_set_.size(), this->string_set_.bucket_count()); |