+2008-05-17 Frank Ch. Eigler <fche@elastic.org>
+
+ * tapsets.cxx (cu_function_cache_t): Switch to <ext/hash_map>s,
+ since these tables tend to get pretty big.
+
2008-05-16 Frank Ch. Eigler <fche@elastic.org>
PR 5643
#include <deque>
#include <iostream>
#include <map>
+#include <ext/hash_map>
#include <set>
#include <sstream>
#include <stdexcept>
#endif
using namespace std;
+using namespace __gnu_cxx;
// ------------------------------------------------------------------------
};
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
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);