30 namespace symbolizer {
47 for (
auto lmap =
_r_debug.r_map; lmap !=
nullptr; lmap = lmap->l_next) {
54 map_.reserve(capacity);
58 for (
size_t i = 0;
i < capacity; ++
i) {
59 slots_.push_back(std::make_shared<ElfFile>());
70 if (pos !=
map_.end()) {
71 return slots_[pos->second];
74 size_t n =
map_.size();
100 auto& entry = pos->second;
106 auto entry = std::make_shared<Entry>();
107 entry->path = p.
str();
108 auto& path = entry->path;
111 const char* msg =
"";
112 int r = entry->file.openAndFollow(path.c_str(),
true, &msg);
123 files_.emplace(entry->path, entry);
131 return std::shared_ptr<ElfFile>(e, &e->file);
void assign(StringPiece s)
std::shared_ptr< ElfFile > getFile(StringPiece path) override
constexpr size_type size() const
std::unordered_map< StringPiece, std::shared_ptr< Entry >, Hash > files_
—— Concurrent Priority Queue Implementation ——
std::shared_ptr< ElfFile > getFile(StringPiece path) override
static std::shared_ptr< ElfFile > filePtr(const std::shared_ptr< Entry > &e)
SignalSafeElfCache(size_t capacity)
boost::container::flat_map< Path, int > map_
size_t countLoadedElfFiles()
const char * data() const
auto lock(Synchronized< D, M > &synchronized, Args &&...args)
std::vector< std::shared_ptr< ElfFile > > slots_
static constexpr size_t kMaxSize
ElfCache(size_t capacity)