Unbreak Symbolizer with small ElfCache
[folly.git] / folly / experimental / symbolizer / ElfCache.h
index f6581940e6e515474051c3faffc6f6b96cc71b72..a2d8993a44767ff31f1851eebaa60aaaf22c5bd8 100644 (file)
@@ -107,7 +107,9 @@ class ElfCache : public ElfCacheBase {
   std::mutex mutex_;
 
   typedef boost::intrusive::list_member_hook<> LruLink;
+
   struct Entry {
+    std::string path;
     ElfFile file;
     LruLink lruLink;
   };
@@ -115,7 +117,10 @@ class ElfCache : public ElfCacheBase {
   static std::shared_ptr<ElfFile> filePtr(const std::shared_ptr<Entry>& e);
 
   size_t capacity_;
-  std::unordered_map<std::string, std::shared_ptr<Entry>> files_;
+  std::unordered_map<
+    StringPiece,
+    std::shared_ptr<Entry>,
+    StringPieceHash> files_;
 
   typedef boost::intrusive::list<
       Entry,