| 48 | Cache() : Cache(GetCacheCapacity()) {} |
| 49 | |
| 50 | ValueType GetObjectCode(const KeyType& cache_key) { |
| 51 | std::optional<ValueType> result; |
| 52 | std::lock_guard<std::mutex> lock(mtx_); |
| 53 | result = cache_.get(cache_key); |
| 54 | return result != std::nullopt ? *result : nullptr; |
| 55 | } |
| 56 | |
| 57 | void PutObjectCode(const KeyType& cache_key, const ValueType& module) { |
| 58 | std::lock_guard<std::mutex> lock(mtx_); |