| 55 | } |
| 56 | |
| 57 | XRTCompilationCache::~XRTCompilationCache() { |
| 58 | VLOG(1) << "XRTCompilationCache::~XRTCompilationCache()"; |
| 59 | // A buggy client may be holding onto a reference, or a client might have |
| 60 | // crashed while holding onto a reference. In either case, discard all |
| 61 | // outstanding client references to avoid leaking storage. |
| 62 | for (const auto& entry : entries_by_uid_) { |
| 63 | while (!entry.second->RefCountIsOne()) { |
| 64 | entry.second->Unref(); |
| 65 | } |
| 66 | } |
| 67 | while (!entries_by_last_use_.empty()) { |
| 68 | MarkOldestEntryForEviction(); |
| 69 | } |
| 70 | CHECK_EQ(cache_.size(), 0); |
| 71 | CHECK_EQ(entries_by_uid_.size(), 0); |
| 72 | CHECK_EQ(cache_entries_, 0); |
| 73 | CHECK_EQ(marked_for_eviction_entries_, 0); |
| 74 | } |
| 75 | |
| 76 | Status XRTCompilationCache::Release(int64 uid) { |
| 77 | absl::MutexLock lock(&mu_); |
nothing calls this directly
no test coverage detected