diff options
author | Frank Ch. Eigler <fche@elastic.org> | 2008-05-17 08:52:19 -0400 |
---|---|---|
committer | Frank Ch. Eigler <fche@elastic.org> | 2008-05-17 08:52:19 -0400 |
commit | 2171f774be4c06664c5d2a0c1b8ef1f8b870ffdb (patch) | |
tree | e1e93ea5141928a2e1e28c12cb615620ff4a9f30 /tapsets.cxx | |
parent | 6561773f763d40c00a115b53493ecf2d4f425d0d (diff) | |
download | systemtap-steved-2171f774be4c06664c5d2a0c1b8ef1f8b870ffdb.tar.gz systemtap-steved-2171f774be4c06664c5d2a0c1b8ef1f8b870ffdb.tar.xz systemtap-steved-2171f774be4c06664c5d2a0c1b8ef1f8b870ffdb.zip |
make the mod_cu_function_cache a hash_map instead of map for more go-go
Diffstat (limited to 'tapsets.cxx')
-rw-r--r-- | tapsets.cxx | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/tapsets.cxx b/tapsets.cxx index 96a93019..c8f77fde 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -20,6 +20,7 @@ #include <deque> #include <iostream> #include <map> +#include <ext/hash_map> #include <set> #include <sstream> #include <stdexcept> @@ -54,6 +55,7 @@ extern "C" { #endif using namespace std; +using namespace __gnu_cxx; // ------------------------------------------------------------------------ @@ -535,8 +537,12 @@ module_cache }; typedef struct module_cache module_cache_t; -typedef map<string,Dwarf_Die> cu_function_cache_t; -typedef map<string,cu_function_cache_t*> mod_cu_function_cache_t; // module:cu -> function -> die +struct stringhash { + size_t operator() (const string& s) const { hash<const char*> h; return h(s.c_str()); } +}; + +typedef hash_map<string,Dwarf_Die,stringhash> cu_function_cache_t; +typedef hash_map<string,cu_function_cache_t*,stringhash> mod_cu_function_cache_t; // module:cu -> function -> die struct symbol_table @@ -2491,7 +2497,7 @@ dwflpp::iterate_over_functions (int (* callback)(Dwarf_Die * func, void * arg), string subkey = q->function; if (v->find(subkey) != v->end()) { - Dwarf_Die die = v->at(subkey); + Dwarf_Die die = v->find(subkey)->second; if (q->sess.verbose > 4) clog << "function cache " << key << " hit " << subkey << endl; return (*callback)(& die, data); |