diff options
author | jimblandy@gmail.com <jimblandy@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2009-09-03 18:27:16 +0000 |
---|---|---|
committer | jimblandy@gmail.com <jimblandy@gmail.com@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2009-09-03 18:27:16 +0000 |
commit | c426b3d98af4c3cc48d97322001963f8b886e8e9 (patch) | |
tree | e24489a8d07ac6403a88e83e8118fbe651ccfec6 /src/common/mac/dwarf/functioninfo.cc | |
parent | Fix text field resizing for 10.5+ SDK (diff) | |
download | breakpad-c426b3d98af4c3cc48d97322001963f8b886e8e9.tar.xz |
Breakpad: Don't use the deprecated __gnu_cxx::hash_map container.
Modern GNU compilers warn about the #inclusion of <ext/hash_map>; that
container is deprecated, and code should use <tr1/unordered_map>
instead. However, to stay within the boundaries of C++ '98, it's
probably fine just to use plain old std::map.
Breakpad uses hash_map in three cases:
o The DWARF reader's SectionMap type maps object file section names to
data. This map is consulted once per section kind per DWARF
compilation unit; it is not performance-critical.
o The Mac dump_syms tool uses it to map machine architectures to
section maps in Universal binaries. It's hard to imagine there
ever being more than two entries in such a map.
o The processor's BasicSourceLineResolver uses a hash_map to map file
numbers to file names. This is the map that will probably have the
most entries, but it's only accessed once per frame, after we've
found the frame's line entry.
a=jimblandy
r=nealsid
git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@393 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/common/mac/dwarf/functioninfo.cc')
-rw-r--r-- | src/common/mac/dwarf/functioninfo.cc | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/src/common/mac/dwarf/functioninfo.cc b/src/common/mac/dwarf/functioninfo.cc index 267d6cf9..3501c035 100644 --- a/src/common/mac/dwarf/functioninfo.cc +++ b/src/common/mac/dwarf/functioninfo.cc @@ -39,27 +39,6 @@ #include "common/mac/dwarf/bytereader.h" -namespace __gnu_cxx { - -// Implement a string hash function so that std::string can be used as a key -// in STL maps and sets. The hash algorithm comes from the GNU C++ library, -// in <tr1/functional>. It is duplicated here because GCC versions prior to -// 4.3.2 are unable to compile <tr1/functional> when RTTI is disabled, as it -// may be in this code. - -template<> -struct hash<std::string> { - std::size_t operator()(const std::string& s) const { - std::size_t result = 0; - for (std::string::const_iterator i = s.begin(); i != s.end(); ++i) - result = (result * 131) + *i; - return result; - } -}; - -} // namespace __gnu_cxx - - namespace dwarf2reader { // Given an offset value, its form, and the base offset of the |