Skip to content

Commit 351ccbb

Browse files
authored
Update LRUCache.cpp
1 parent 4070f87 commit 351ccbb

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/LRUCache.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,11 @@ void LRUCache::evict() {
5656
access_order.pop_back();
5757
cache.erase(key_to_evict);
5858
}
59+
60+
// Add this function to LRUCache.cpp
61+
void LRUCache::reset() {
62+
std::lock_guard<std::mutex> lock(cache_mutex);
63+
cache.clear();
64+
access_order.clear();
65+
resetStats();
66+
}

0 commit comments

Comments
 (0)