51 size_t get(
h256 const& _hash)
const void removeRandomElement()
Removes a random element from the cache.
Adapted from code found on http://stackoverflow.com/questions/180947/base64-decode-snippet-in-c Origi...
std::unique_lock< std::mutex > UniqueGuard
void store(h256 const &_hash, size_t size)
static const size_t c_maxSize
Simple thread-safe cache to store a mapping from code hash to code size.
bool contains(h256 const &_hash) const
static FixedHash random()
std::map< h256, size_t > m_cache
uint8_t const size_t const size
static CodeSizeCache & instance()