proxygen
|
#include <ElfCache.h>
Classes | |
class | Path |
Public Member Functions | |
SignalSafeElfCache (size_t capacity) | |
std::shared_ptr< ElfFile > | getFile (StringPiece path) override |
Public Member Functions inherited from folly::symbolizer::ElfCacheBase | |
virtual | ~ElfCacheBase () |
Private Attributes | |
Path | scratchpad_ |
boost::container::flat_map< Path, int > | map_ |
std::vector< std::shared_ptr< ElfFile > > | slots_ |
Cache ELF files. Async-signal-safe: does memory allocation upfront.
Will not grow; once the capacity is reached, lookups for files that aren't already in the cache will fail (return nullptr).
Not MT-safe. May not be used concurrently from multiple threads.
NOTE that async-signal-safety is preserved only as long as the SignalSafeElfCache object exists; after the SignalSafeElfCache object is destroyed, destroying returned shared_ptr<ElfFile> objects may cause ElfFile objects to be destroyed, and that's not async-signal-safe.
Definition at line 63 of file ElfCache.h.
|
explicit |
Definition at line 53 of file ElfCache.cpp.
References i, map_, and slots_.
|
overridevirtual |
Implements folly::symbolizer::ElfCacheBase.
Definition at line 63 of file ElfCache.cpp.
References folly::symbolizer::SignalSafeElfCache::Path::assign(), folly::symbolizer::SignalSafeElfCache::Path::data(), f, folly::symbolizer::SignalSafeElfCache::Path::kMaxSize, folly::symbolizer::ElfFile::kSuccess, map_, scratchpad_, folly::Range< Iter >::size(), and slots_.
|
private |
Definition at line 109 of file ElfCache.h.
Referenced by getFile(), and SignalSafeElfCache().
|
private |
Definition at line 108 of file ElfCache.h.
Referenced by getFile().
|
private |
Definition at line 110 of file ElfCache.h.
Referenced by getFile(), and SignalSafeElfCache().